Fix negative average shown for already-achieved grades - #3
Open
pcuj123-glitch wants to merge 1 commit into
Open
Conversation
When the required average on remaining work is negative (meaning the student already meets the target grade), return required_avg as None so the frontend displays 'Already secured' instead of a confusing negative percentage like -1.2%. Fixes both _calc_weighted_targets and _calc_total_points_targets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
theaayushstha1
added a commit
that referenced
this pull request
Apr 10, 2026
Issue #1 - Gemini skips KB search: - New: adk_agent/kb_prefetch.py - in-memory TF-IDF prefetch (<10ms) - agent.py: before_model_callback injects top 3 KB docs into system instruction - Belt-and-suspenders: even if Gemini skips VertexAiSearchTool, docs are in prompt Issue #2 - Instruction bloat (11,908 -> 3,903 chars, 67% reduction): - agent.py: Consolidated 9 grounding rules into 4, 9 security rules into 4 - Removed verbose course rec steps, UI features conditionally injected - YOUR CAPABILITIES compressed from 4282 to ~1500 chars Issue #3 - No automated regression tests: - New: backend_provider.py for promptfoo (tests full pipeline via /chat/guest) - 12 new tests: Drive links, security refusals, factual accuracy, edge cases - New: run_tests.sh CI gate script (fails below 90% pass rate) Issue #4 - main.py monolith (4200 lines): - New: deps.py (shared dependencies, Pydantic models, auth helpers) - New: routers/auth.py (register, login, verify, resend - 4 endpoints) - Pattern proven, ready for incremental extraction of chat/admin/integrations Pipeline simplification: - Removed gates from hot path (retrieval_gate, verification_gate, fast_retrieval) - Disabled semantic cache (0.95 threshold = expensive exact match) - Gated LLM rewriter (5+ word queries skip to agent session context) Benchmark: 30/30 pass, 0 hallucinations, 4.4s median, 3.9K instruction Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
_calc_weighted_targetsand_calc_total_points_targetsinbackend/services/canvas_analytics.pyto returnrequired_avg: Nonewhen the needed average is ≤ 0required_avg == nullcorrectly by displaying "Already secured"Test plan