Build end-to-end argument analyzer API#7
Open
Spbd1 wants to merge 1 commit into
Open
Conversation
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.
Motivation
Description
engine/argument_risk_engine/scoring/by addingcalibration.py(calibration profile, thresholds, severity weights) and expandingscorer.pywithcalculate_risk_score,score_classification, legacy compatibility, and gating logic.engine/argument_risk_engine/analyzer.pyto extract claims, retrieve candidates, classify deterministically, convert evidence to absolute offsets, apply scoring, assemble structured claim/risk outputs, compute stabletext_id, and expose diagnostic/healthy-pattern toggles.engine/argument_risk_engine/explanation/explainer.pyfor inclusion in the report.backend/app/schemas/analysis.py(request/response and nested models),backend/app/services/analyzer_service.pyto call the analyzer, andbackend/app/api/routes_analysis.pyto addPOST /analyzeand keep legacyPOST /api/analysis/analyzewhile also exposing/api/analyze; added an import shim inbackend/app/__init__.pyto ensure the engine package is importable from the app.uvicornmodule shims for localpython -m uvicorninvocation and updated tests to validate scoring, analyzer shape/stability, and API endpoints (tests/test_scorer.py,tests/test_analyzer.py,tests/test_api_analysis.py).Testing
pytest -q, which passed (39 passed, 3 warnings).python -m compileall backend engine tests uvicornwith no compile errors.python -m uvicorn backend.app.main:app --reloadas a smoke test; the console entrypoint formuvicorn ...is not available in this environment (not installed) but the module start succeeded.Codex Task