Skip to content

feat(profiles): auto-profile quality accept-gate + raw quality signals#92

Merged
dongwhee merged 1 commit into
developfrom
feat/profile-quality-stage1
Jul 6, 2026
Merged

feat(profiles): auto-profile quality accept-gate + raw quality signals#92
dongwhee merged 1 commit into
developfrom
feat/profile-quality-stage1

Conversation

@dongwhee

@dongwhee dongwhee commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stage 1 of the self-healing-profiles direction (prereq for enabling TRAWL_MCP_AUTO_PROFILE=1 in the deployment, and groundwork for the Stage-2 feedback re-profile loop).

(a) Quality accept-gate, auto path only. After auto_profile generates a profile, it is classified with the same heuristic profile_eval uses (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, and the payload notes auto_profile_rejected: quality:<tag>/<depth>. Explicit profile_page is 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_score and profile_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

Gate Result
Full pytest 463 passed
Parity (TRAWL_FETCH_CACHE_TTL=0) 15/15
MCP stdio smoke PASS
New unit tests (gate accept/reject/delete/cooldown; coverage math; None-safety) pass
/code-review low clean (imported profile API symbols verified live)

🤖 Generated with Claude Code

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).
@dongwhee dongwhee merged commit 85f6125 into develop Jul 6, 2026
3 of 4 checks passed
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