Repository navigation
feat: L2 event manifest as preferred StopLoss feature source - #467
Merged
Merged
Conversation
stoploss_lib now prefers a Folio-style L2 manifest (fusion-code-events.jsonl, #462) over stream-json when both exist: _is_l2_manifest detects the record shape, l2_to_events adapts bounded digests into pseudo stream events (digest-based repeat_identical fingerprints), resolve_feature_source picks the source. The external adapter copies the run's newest matching L2 sidecar from ~/.fusion-code/projects into logs_dir so the dataset builder sees it. Validated on the S1 trial fix-git__CzCsxVs: L2-derived and stream-derived features agree on all six values (turns=11, no_edit_streak=11, seconds_per_turn=88.87); stream-json stays as fallback for pre-#462 runs. Refs #449 Co-Authored-By: Claude Code <[email protected]>
This was referenced Dec 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
StopLoss feature extraction (#449) now prefers the Folio-style L2 event manifest (shipped in #462,
FUSION_CODE_L2_MANIFEST=1) over raw stream-json when both exist.stoploss_lib.py:_is_l2_manifestdetects the record shape (kind=tool_use/tool_result/text),l2_to_eventsadapts bounded digests into pseudo stream events so the existing feature extractors work unchanged;resolve_feature_sourcepicks L2 first, stream-json fallback for pre-feat: L2 event manifest sidecar (FUSION_CODE_L2_MANIFEST=1) #462 runs.fusion_code_agent_external.py: after each trial, copy the run's newest matching*.events.jsonlsidecar from~/.fusion-code/projectsintologs_dirasfusion-code-events.jsonl(best-effort, fail-open).stoploss_dataset.py: useresolve_feature_source.Why
The L2 manifest is bounded (200-char digests), compact, and written at a single choke point — a cheaper and more stable monitor input than multi-MB stream logs. Digest-based fingerprints can collide in theory, which only makes the monitor more conservative.
Validation
S1 trial
fix-git__CzCsxVs: L2-derived and stream-derived features agree on all six values (turns=11, no_edit_streak=11, seconds_per_turn=88.87). Synthesized L2 manifest feeds the dataset builder end-to-end (1 sample produced).Refs #449
🤖 Generated with Claude Code