Repository navigation
fix(profiles): a Codex apply_patch counts as an edit in the style observation (#727, slice 1) - #882
Merged
Merged
Conversation
…ervation (#727, slice 1) The incremental style observation matched Claude tool names only (Edit/Write, Read/Grep), so a Codex session whose edits arrive as apply_patch produced an empty observation where the same Claude edit gave activeReflective=0.3. core/tool_operation.py names the common operation a native tool stands for; native names stay in toolsUsed for provenance, and the opaque exec stays unclassified. Refs #727 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYtyEZfhpzqaqPcdkeA
4 tasks
cdeust
marked this pull request as ready for review
November 6, 2026 00:28
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…n-signal # Conflicts: # CHANGELOG.md
Review 1 of 3: PR #882 (head 12ec495)Five reviews ran: code quality, test coverage, documentation accuracy, security and performance. Blockers: none. What was checked:
Notes, no action before merge
I didn't run pytest, ruff or the craftsmanship gate myself: running Python needed approval in this runner. These results come from reading the code. Verdict: approve |
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.
Summary
First slice of #727. The incremental style observation (
core/profile_builder._build_style_observation) recognized Claude tool names only (Edit/Writeas edits,Read/Grepas reads). A Codex rollout records its edits asapply_patch(infrastructure/transcript_rollout.py), so the issue's replay holds: a one-tool session withduration=NonegaveactiveReflective=0.3forEditand an empty observation forapply_patch.Root cause: the operation an observation reads was inferred from a Claude tool name, not from a host-independent operation. Fix: new pure module
core/tool_operation.pymaps each native name to the operation it makes explicit (apply_patch→ edit, ashooks/host_patch.pyalready does on the hook path). Native names stay as recorded intoolsUsed(provenance).exec(an arbitrary program) stays unclassified (None): it is not guessed into a read.The function's final clamp to [-1, 1] is removed:
activeReflectiveis one of {0.5, 0.0, -0.5} plus at most +0.3 and -0.3, so it stays within [-0.8, 0.8]. The clamp never acted, and its 4 mutants were equivalent;update_style_emaclamps the blended value anyway.Refs #727
Remaining slices (not in this PR):
persona_vector(readstoolPreferenceskeyed by native name),sparse_dictionary_activationandstyle_classifier(full rebuild path), with a cross-client test on transcript-derived EMA, persona and feature activation.Type of change
Test plan
pytest tests_py/core/test_tool_operation.py tests_py/core/test_profile_builder.py: 31 passed. The new testtest_apply_patch_session_observation_equals_edit_sessionfails onmain(checked with the fix stashed) and passes here.pytest tests_py/core/: 3729 passed, 1 failed (test_wiki_coverage_dashboard.py::test_unreadable_page_is_skipped_not_fatal). It fails the same way onmainin this container, which runs as root, so a chmod'd file stays readable.GITHUB_BASE_REF=main python scripts/ci_mutation_diff.py:2 file(s), 0 failed, 0 untested(_build_style_observation: 0 survivors in scope;tool_operation.py: 5/5 killed).ruff check/ruff format --checkon the changed files: clean.python scripts/check_craftsmanship.py: OK.Audit notes
apply_patch→ edit followshooks/host_patch.py;execis left unknown, as the issue requires.Coding-standards compliance
core/tool_operation.pyimports nothing).Reviewer checklist
docs/module-inventory.md).Generated by Claude Code