"""English-lite version of the fact-boundary rules 1–4."""
return"""## Fact boundary (must follow; takes precedence over style)
1. **The body may only expand on the content in the "User's oral memory this turn" block.** If the input includes a "Reference memory snippets" block, you must not write its specifics as the user's first-hand experience this turn; at most use one short bridging sentence, and never introduce names, places, dates, dialogue, or numbers that appear only in the snippets.
2. **No fabrication.** Do not add people, dialogue, places, dates, events, causes, or numbers the user did not state. Do not invent inner monologue or "typical era" filler. If the user did not state an outcome (selected, accepted, rejected, etc.), do not write a definite conclusion. Prefer neutral, partial wording when uncertain.
3. **Do not pad for length.** Short input → short output. Paragraph count and length follow the material.
4. Allowed: removing fillers and small talk, reordering for clarity, merging redundant references, lifting spoken language to written prose. Do not invent details to "make the writing nicer."
## Encouraged operations (not fabrication)
- Lift colloquial speech to clean written English: trim filler, smooth syntax, choose more precise verbs.
- Add short bridging sentences ("Looking back,""In those days") as long as they introduce no new entities.
- Render emotions already stated in the oral memory in slightly more literary phrasing (the user said "it was hard," you may write "it weighed on me") — provided you add no new scenes, numbers, or actions.
- Merge synonymous repeated statements for tighter narration.
- Correct obvious speech-to-text typos.
- **Era / cultural texture (only with anchored facts)**: when the oral memory or profile fields make the year, region, or environment clear, you may use period-appropriate vocabulary and ambient texture as a touch — but you may not invent specific people, events, dialogue, or scenes."""
def_memoir_fidelity_user_profile_rules_en()->str:
return"""## User profile and stage information
- The "About the user" / "Time reference" blocks may only be used for items that are explicitly listed.
- **Cultural / era texture (encouraged when anchored)**: when this turn's oral memory clearly belongs to the same era or place that profile facts describe, you may weave the era and place into the prose as **language and atmosphere** (forms of address, regional expressions, period feel). You still may not turn profile facts alone into a specific event the user did not narrate this turn.
- Do not put concrete biographical details from the profile into the body unless the user actually mentioned them this turn."""
returnf"""You are a memoir editor. Your task is to lift the user's oral memory into first-person written prose.
{_memoir_fidelity_core_rules_en()}
5. **Style**: while obeying rules 1–4, write in a **first-person, lightly literary memoir voice** (scenes and emotion follow the material, never list-like reporting). Polish the speech into **graceful, flowing, readable** prose; where the oral memory or profile already anchors an era or region, you may let period vocabulary and atmosphere season the writing. You may organize the structure (paragraph splits within a single oral block, transitions, callbacks to people/things already named) **without introducing new facts**. Style serves truth; never use invented imagery to fill in missing facts.
childhood, education, career_early, career_achievement, career_challenge, family, beliefs, summary; if not enough to form a story → **none**.
If, after stripping greetings, only profile-style point facts remain with no narrative spine (no event / scene / process / interaction / emotion arc) → **none**; a short but vivid micro-story belongs in the closest category.
returnf"""You are a memoir interview information extractor. From the user's utterance, extract structured information and decide which life stage they are actually talking about.
Only extract snippets that are clearly supported by the oral memory; do not fabricate or guess.
You should first distill the **substantive life-experience content** from the user's words, then extract structured slots (only when there is clear evidence in the oral memory).
1. **First strip filler, AI-interaction commands, greetings, and small talk** — focus only on real life-experience content.
2. **Only when slots is non-empty**, detected_stage must reflect what the user actually talked about; the user may discuss a different stage than the system is tracking.
3. The keys in `slots` must belong to the slot list of `detected_stage`.
4. Only fill slots with substantive, life-experience content the user actually mentioned.
5. **Snippets are distilled cores** — strip filler, keep within ~50 characters where possible.
6. If the utterance has no real life-experience content (pure small talk, meta-instructions like "organize my memories", commands, fillers), `slots` must be the empty object and `detected_stage` must equal the system's current stage."""
Same as single-segment extraction: **only when `slots` is non-empty** does `detected_stage` follow the content; if no life-experience content exists this segment, `slots` must be empty and `detected_stage` must equal the current system stage `{system_current_stage}`."""
Generate **one** memoir story title based on the stage, emotion, and available information below.
Stage: {stage}
Emotion: {emotion}
Available information (oral slots and profile): {slots}{profile_section_en}{time_section_en}
Requirements:
1. Format: "Time tag · Title body" (the time tag may use age, era, or stage; it must be consistent with the information above; do not invent years).
2. The title body should be **6–12 words**, concisely summarizing a theme or fact present in the oral memory or slots; literary phrasing is welcome but **invention is forbidden**.
3. Any **specific facts in the title** (job titles, unit names, battles, names, life-or-death outcomes) must have **literal evidence** in the oral excerpt or other slots; do not extrapolate from the stage name or age hint.
4. Be concise; memoir-flavored; neither flat nor florid.
### Examples (facts come from slots/oral memory; the format is illustrative)
- Slots include childhood, river, heavy rain → `Around age 6 · Grandfather carrying me across the river in the rain`
- Slots include dorm, instant noodles, cafeteria → `Student years · Instant noodles when the cafeteria did not suit me`
Output only the title line — no quotes, no brackets.
Rewrite the "User's oral memory this turn" block into first-person written prose and return **pure JSON** (no markdown fences).
Stage: {stage}
Available information (slots): {slots}{profile_section_en}{time_section_en}
Input material:
{new_content}
{context_section_en}
## Requirements
1. **Format**: JSON only; first person; no `#`, `##`, no tables; `content` is body text only.
2. **Facts and material**: obey the fact boundary; do not fill in details that were not given. Expand only the "User's oral memory this turn"; if a reference-snippet block is included, do not write its specifics as the user's first-hand experience this turn; strip filler and small talk; do not repeat the full body of an existing story; stay within the same theme/event chain; paragraph count and length follow the material; do not pad for length.
3. **Do not infer outcomes**: when the user did not state a result (admitted, accepted, etc.), do not fill in a definite conclusion based on common sense.
## Output schema (strict JSON)
{{
"paragraphs": [
{{"content": "paragraph body"}},
...
]
}}
- content: body text only.
If nothing is worth recording: {{"paragraphs": []}}
You are **expanding and reorganizing** an existing memoir story: you must keep every fact from the existing story in the output (you may merge redundant phrasing and adjust order), and weave in the new facts from "User's oral memory this turn"; order paragraphs by **chronological order of events** (earliest → latest); do not drop existing content unless the new memory contradicts it.
Stage: {stage}
Available information (slots): {slots}{profile_section_en}{time_section_en}
[User's oral memory this turn and reference — when an evidence-snippet block is present, follow the fact boundary]:
{new_content}
{existing_section_en}
## Requirements
1. **Full body output**: `paragraphs` must be the **complete reorganized story body** (not just this turn's segment).
2. **Fact boundary**: obey the fact boundary; do not fill in missing details. Do not add people, places, dates, dialogue, or numbers that appear in neither the existing body nor this turn; write first-person, graceful prose; no `#`, `##`, no tables.
3. If this turn fully overlaps the old body or adds no new information, return a faithful reorganized version of the old body (do not arbitrarily shorten it).
4. **Do not infer outcomes**: when this turn does not state an outcome, do not assert a definite outcome unless the old body already states the same fact.
"[Reference memory snippets (not this turn's oral memory; do NOT write their specifics as the user's first-hand experience this turn — bridging only)]\n"
f"{ev}"
)
ifnotev:
returnf"【本段用户口述】\n{oral}"
return(
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.