feat(profiles): auto-profile quality accept-gate + raw quality signals#92
Merged
Conversation
Stage 1 of the self-healing-profiles direction (owner, 2026-07-07): (a) Accept-gate, auto path only: after auto_profile generates a profile, classify it with the profile_eval heuristic (ideal: lca_tag in ARTICLE/MAIN or depth>=4 non-BODY/HTML/DIV; acceptable: depth>=3). Below acceptable -> the just-saved profile is deleted, the host joins the failed-host cooldown, payload notes auto_profile_rejected, and the original result is returned. Explicit profile_page is unaffected (human judgment respected). Prevents the pypi-precedent failure mode where a degenerate profile is silently institutionalized by an unattended trigger. (b) Measure-only quality signals: profile-path results now carry profile_top_score (top chunk ranking score) and profile_query_coverage (BM25-tokenized query-term coverage of returned chunks; None when queryless). Both land in telemetry (SCHEMA_VERSION 1 -> 2). No behavior depends on them yet — they feed the Stage-2 feedback re-profile threshold design from production data. Gates: full pytest 463, parity 15/15, MCP smoke, new unit tests (gate accept/reject/delete/cooldown, coverage math, None-safety).
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
Stage 1 of the self-healing-profiles direction (prereq for enabling
TRAWL_MCP_AUTO_PROFILE=1in the deployment, and groundwork for the Stage-2 feedback re-profile loop).(a) Quality accept-gate, auto path only. After
auto_profilegenerates a profile, it is classified with the same heuristicprofile_evaluses (ideal:lca_tagin ARTICLE/MAIN or depth≥4 non-BODY/HTML/DIV; acceptable: depth≥3). Below acceptable → the just-saved profile is deleted, the host joins the failed-host cooldown, and the payload notesauto_profile_rejected: quality:<tag>/<depth>. Explicitprofile_pageis unaffected. This prevents the pypi-precedent failure mode (a degenerate profile silently institutionalized) from happening unattended.(b) Measure-only quality signals. Profile-path results now carry
profile_top_scoreandprofile_query_coverage(BM25-tokenized query-term coverage), recorded in telemetry (SCHEMA_VERSION 1 → 2). No behavior depends on them — they exist so Stage-2 detection thresholds are designed from production data, not intuition.Gates
🤖 Generated with Claude Code