Skip to content

[HV2] extractor quality: NPC dialogue-snippet mining + quest wrap-up capture (#1329)#1368

Open
100yenadmin wants to merge 1 commit into
mainfrom
hv2/extractor-quality
Open

[HV2] extractor quality: NPC dialogue-snippet mining + quest wrap-up capture (#1329)#1368
100yenadmin wants to merge 1 commit into
mainfrom
hv2/extractor-quality

Conversation

@100yenadmin

Copy link
Copy Markdown
Member

Why

The first LIVE promotion batch (PR #1354, merged) scored 11 extracted artifacts and promoted only 1. The rejections were legible: several NPC extracts carried empty/thin dialogue_snippets, and quests lacked narrative wrap-up context — so they failed the promotion gate on those grounds. Raising extraction QUALITY directly raises the promotable fraction (the flywheel's throughput). Follow-up on epic #1329 / the HV3 first-promotion finding.

What changed

1. NPC dialogue — extract the VOICE, not the narration.
dialogue_snippets now mines in-voice quoted lines the NPC actually SPOKE: a quoted span (straight/curly double quotes, curly single) is kept only when the NPC's name (first OR last token) AND a speech-attribution verb sit tight (~60 chars) around the quote. The old matcher kept any narration block mentioning the name — combat rosters (Party (Aldric 40/40, Maren 31/31)...), scene-setting — which is the "described-not-voiced" failure that forces voice_distinctiveness ≤ 2 under qa/rubric_artifact_npc.md. Markdown emphasis is stripped, mid-sentence fragments and possessive-apostrophe false quotes are filtered, and a silent NPC returns [] (graceful).

2. Quest wrap-up / resolution context.
Quest payload gains additive description (Quest.description, previously dropped) and a resolution object {status, evolves_to, callback_in_days, wrap_up[]}, where wrap_up mines the closing transcript beats that name the quest AND carry resolution language (outcome/consequence cues, with the quest's own title tokens masked out so a title like The Price of Silence doesn't self-trigger the the price cue). This is the outcome context qa/rubric_artifact_quest.md scores for consequence_weight / narrative completeness.

3. Schema — additive-only.
data/library/artifact_schema.json: quest_payload gains optional description + resolution; envelope, per-class required keys, and provenance.source (HV1's optional field) are unchanged. HV2's merged schema stays canonical.

Invariants

  • Read-only on play-state (unchanged): loads snapshots, never saves.
  • Additive schema only; both new quest fields optional, old artifacts round-trip.
  • Extractor stays a sibling of export_scene_grid.py; offline-testable (fabricated transcript fixtures, no live LLM).

Before / after (5 real campaigns, re-extracted read-only)

campaign NPC snippets (old→new) quest wrap_up quest description
baseline-rc1 2→3 1 1
glm-arc-bg1 6→5 1 1
claude-v2-2 3→4 1 1
claude-v2-3 2→2 1 1
glm-duo-h 2→0 0 1
totals (62 NPCs / 5 quests) 15→14 present 0→4 0→5

The NPC count is ~flat, but the CONTENT flips from combat-roster noise (Party confirmed: Aldric (40/40)...) to genuine in-voice lines ("I'd rather we pull together," Wyll / "Lord Wyll. Sir. Begging your pardon." / "So I don't want your gold..."). Quest wrap-up + description go from absent to present on nearly every quest — new signal the promotion panel can score. (glm-duo-h's 2→0 were false-positive combat mentions correctly dropped.)

Tests

  • qa/test_export_campaign_artifacts.py: 36 passed (was 15) — -p no:xdist. In-voice attribution (pre/post), third-person + possessive-apostrophe exclusion, mid-sentence-fragment drop, dedup+cap, curly quotes, quest wrap-up cue matching + title-token cue masking, graceful empty/silent cases; golden fixture updated for the new fields.
  • qa/fast_gate.sh: T0 PASS (257 passed).
  • ruff check: clean.
  • jsonschema: 43 real extracted artifacts validate against envelope + per-class payload defs (additive fields accepted).

Do not merge — orchestrator runs the live promotion panel. Part of #1329.

…capture (#1329)

The first live promotion batch (PR #1354) promoted only 1 of 11 artifacts: NPC
extracts carried empty/thin dialogue_snippets and quests lacked narrative wrap-up.
Raising extraction quality raises the promotable fraction.

NPC dialogue (voice, not narration): dialogue_snippets now mines IN-VOICE quoted
lines the NPC actually SPOKE — a quoted span (double/curly quotes) kept only when
the NPC name AND a speech-attribution verb sit tight around it. The old matcher kept
any narration block mentioning the name (combat rosters, scene-setting), which is
'described-not-voiced' and caps voice_distinctiveness under qa/rubric_artifact_npc.md.
Mid-sentence fragments and possessive-apostrophe false quotes are filtered; a silent
NPC returns [] (graceful).

Quest wrap-up: quest payload gains additive 'description' (Quest.description, was
dropped) and a 'resolution' object {status, evolves_to, callback_in_days, wrap_up[]}
where wrap_up mines closing transcript beats naming the quest AND carrying resolution
language — the outcome context qa/rubric_artifact_quest.md scores for consequence_weight.

Schema (data/library/artifact_schema.json): additive-only, both new quest fields
optional; envelope + provenance.source unchanged. Read-only on play-state (unchanged);
extractor stays a sibling of export_scene_grid.py.

Tests (-p no:xdist): 36 pass (was 15) — in-voice attribution, third-person/possessive
exclusion, mid-sentence-fragment drop, dedup/cap, curly quotes, quest wrap-up cue
matching + title-token cue masking, graceful empty cases. fast_gate T0: 257 pass.
ruff clean. jsonschema: 43 real artifacts validate.

Before/after on 5 real campaigns: quest wrap_up 0->4 (of 5), description 0->5;
NPC snippets shift from combat-roster noise to genuine in-voice quotes.

#1329
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 49 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9bb39e9f-6ed2-4fd5-8be6-c7a1c5ff567d

📥 Commits

Reviewing files that changed from the base of the PR and between 0ca870b and 8eed3aa.

📒 Files selected for processing (3)
  • data/library/artifact_schema.json
  • qa/export_campaign_artifacts.py
  • qa/test_export_campaign_artifacts.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hv2/extractor-quality

Comment @coderabbitai help to get the list of available commands.

@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

evaOS review status: in progress

PR: #1368 - [HV2] extractor quality: NPC dialogue-snippet mining + quest wrap-up capture (#1329)
Head: 8eed3aaa061a577e9b57055ad89c7cd58a3d697f
Updated: 2026-07-06T19:44:12.597Z

evaOS review is running for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #1368

@100yenadmin

Copy link
Copy Markdown
Member Author

Architect review (verdict-as-comment): the in-voice mining is the RIGHT fix — quotes kept only when the NPC name + a speech verb co-occur in a tight window (kills the combat-roster false-positives that capped voice_distinctiveness ≤2); read-only on play-state preserved; schema additive-only (quest description + resolution.wrap_up both OPTIONAL, envelope unchanged); 5-campaign before/after shows wrap_up 0→4, description 0→5, snippets flip to genuine voice. 36 + 257 green, 43 artifacts re-validate. The two-NPC mis-speaker heuristic limit is acceptable (real speech, flagged). This raises the next promotion batch's yield. Merge on CI+bot green.

@100yenadmin 100yenadmin enabled auto-merge (squash) July 6, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant