django-explain-errors 0.9.2__tar.gz → 0.9.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {django_explain_errors-0.9.2/django_explain_errors.egg-info → django_explain_errors-0.9.3}/PKG-INFO +25 -33
  2. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/README.md +24 -32
  3. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3/django_explain_errors.egg-info}/PKG-INFO +25 -33
  4. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/setup.py +1 -1
  5. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/LICENSE +0 -0
  6. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/MANIFEST.in +0 -0
  7. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/django_explain_errors.egg-info/SOURCES.txt +0 -0
  8. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/django_explain_errors.egg-info/dependency_links.txt +0 -0
  9. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/django_explain_errors.egg-info/requires.txt +0 -0
  10. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/django_explain_errors.egg-info/top_level.txt +0 -0
  11. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/__init__.py +0 -0
  12. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/client.py +0 -0
  13. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/debug_page.py +0 -0
  14. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/management/__init__.py +0 -0
  15. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/management/commands/__init__.py +0 -0
  16. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/management/commands/build_error_index.py +0 -0
  17. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/middleware.py +0 -0
  18. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/rag/__init__.py +0 -0
  19. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/rag/indexer.py +0 -0
  20. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/rag/retriever.py +0 -0
  21. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/rag/store.py +0 -0
  22. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/sanitize.py +0 -0
  23. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/throttle.py +0 -0
  24. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/explain_errors/tracebacks.py +0 -0
  25. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/setup.cfg +0 -0
  26. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_build_error_index.py +0 -0
  27. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_client.py +0 -0
  28. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_debug_page.py +0 -0
  29. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_eval_fixtures.py +0 -0
  30. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_eval_judge.py +0 -0
  31. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_eval_run.py +0 -0
  32. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_language.py +0 -0
  33. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_middleware.py +0 -0
  34. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_print_stdout.py +0 -0
  35. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_rag.py +0 -0
  36. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_sanitize.py +0 -0
  37. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_signals.py +0 -0
  38. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_throttle.py +0 -0
  39. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_tracebacks.py +0 -0
  40. {django_explain_errors-0.9.2 → django_explain_errors-0.9.3}/tests/test_truncation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-explain-errors
3
- Version: 0.9.2
3
+ Version: 0.9.3
4
4
  Summary: Django middleware that explains unhandled exceptions in DEBUG using an LLM, optionally grounded in your own project source via a local vector index. Works with OpenAI, Claude, or any OpenAI-compatible endpoint including local models.
5
5
  Home-page: https://github.com/topunix/django-explain-errors
6
6
  Author: topunix
@@ -546,41 +546,33 @@ django.db.utils.IntegrityError: NOT NULL constraint failed: blog_post.author_id
546
546
 
547
547
  ### Does RAG actually help?
548
548
 
549
- To check whether RAG-grounded explanations are actually better, not just
550
- longer, the package ships an eval harness (`evals/`): fifteen deliberately
551
- broken Django views, each explained twice (once from the traceback alone,
552
- once with RAG enabled) and judged by a separate model, blind to which
553
- explanation is which, against the error's known cause and correct fix
554
- location. Which side the judge sees as "A" is randomized per comparison so
555
- position can't bias the result.
556
-
557
- Across three runs (45 judged comparisons, 2 judge failures, 43 scored),
558
- RAG-on won 35, RAG-off 5, and 3 tied. The gap isn't spread evenly across
559
- everything the judge checks. It's concentrated in whether the explanation
560
- names the right file and function, and whether it invents details along
561
- the way: on `points_to_fix_location`, RAG-on answered yes in 26 of the
562
- group-A comparisons against RAG-off's 13; on `no_fabrication`, 26 against
563
- 17. Without source access, `gpt-4o-mini` tends to invent a
564
- plausible-sounding function name or parameter rather than say it doesn't
565
- know; given the actual code via RAG, it mostly does not.
566
-
567
- Three limitations are worth knowing before trusting this uncritically: RAG
568
- can anchor on the wrong retrieved chunk, as it did in one fixture
569
- (`missing_post_key`) where the fix got redirected to a retrieved template
570
- instead of the view; the judge is shown the failing function's own
571
- source, which is the same source RAG-on's retriever draws from, so part
572
- of RAG-on's `no_fabrication` advantage may be judge and generator
573
- overlapping on material RAG-off never sees rather than RAG-on being more
574
- careful; and claim statuses are spot-checked, not exhaustively audited --
575
- a script that flagged 14 of 363 claims on one run, all correct on manual
576
- inspection, is a sample that turned up no false positive, not a proof
577
- that none exists. Full per-fixture results, the judge prompt, and how to
578
- reproduce this (about $1.37 for a `--runs 3` pass, most of it judge cost)
579
- are in [`evals/README.md`](evals/README.md).
549
+ The package can explain an error in two ways:
550
+
551
+ - **RAG-off (default):** the model sees only the Django traceback.
552
+ - **RAG-on:** the model also sees relevant source code from your project, retrieved from a local index.
553
+
554
+ The eval harness in `evals/` tests whether RAG-on explanations are more accurate, not just longer. It triggers 15 deliberately broken Django views, explains each one both ways, and has a separate judge model compare the two against the error's known cause and fix location. The judge doesn't know which explanation used RAG, and their order is randomized.
555
+
556
+ **Results (3 runs, 43 scored comparisons):** RAG-on won 35, RAG-off won 5, and 3 tied.
557
+
558
+ Most of the gap comes from two checks, measured on the 10 fixtures whose cause is in the app's own code (30 comparisons):
559
+
560
+ - **Points to the right file and function:** RAG-on 26, RAG-off 13
561
+ - **Avoids invented details:** RAG-on 26, RAG-off 17
562
+
563
+ Without your source, gpt-4o-mini tends to invent a plausible function name or parameter rather than admit it doesn't know. With the real code in front of it, it mostly doesn't.
564
+
565
+ **Limitations:**
566
+
567
+ - RAG can retrieve the wrong code. In one fixture (`missing_post_key`), it pointed the fix at a template instead of the view.
568
+ - The judge checks claims against the same source RAG-on retrieves from, which may inflate RAG-on's score for avoiding invented details.
569
+ - Claims are spot-checked, not fully audited. All 14 claims flagged on one run held up on manual review, but that is a sample, not proof.
570
+
571
+ Full results, methodology, and how to reproduce (about $1.37 per `--runs 3` pass) are in [evals/README.md](https://github.com/topunix/django-explain-errors/blob/main/evals/README.md).
580
572
 
581
573
  ## License
582
574
 
583
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
575
+ This project is licensed under the MIT License. See the [LICENSE](https://github.com/topunix/django-explain-errors/blob/main/LICENSE) file for details.
584
576
 
585
577
  ## Contributing
586
578
 
@@ -496,41 +496,33 @@ django.db.utils.IntegrityError: NOT NULL constraint failed: blog_post.author_id
496
496
 
497
497
  ### Does RAG actually help?
498
498
 
499
- To check whether RAG-grounded explanations are actually better, not just
500
- longer, the package ships an eval harness (`evals/`): fifteen deliberately
501
- broken Django views, each explained twice (once from the traceback alone,
502
- once with RAG enabled) and judged by a separate model, blind to which
503
- explanation is which, against the error's known cause and correct fix
504
- location. Which side the judge sees as "A" is randomized per comparison so
505
- position can't bias the result.
506
-
507
- Across three runs (45 judged comparisons, 2 judge failures, 43 scored),
508
- RAG-on won 35, RAG-off 5, and 3 tied. The gap isn't spread evenly across
509
- everything the judge checks. It's concentrated in whether the explanation
510
- names the right file and function, and whether it invents details along
511
- the way: on `points_to_fix_location`, RAG-on answered yes in 26 of the
512
- group-A comparisons against RAG-off's 13; on `no_fabrication`, 26 against
513
- 17. Without source access, `gpt-4o-mini` tends to invent a
514
- plausible-sounding function name or parameter rather than say it doesn't
515
- know; given the actual code via RAG, it mostly does not.
516
-
517
- Three limitations are worth knowing before trusting this uncritically: RAG
518
- can anchor on the wrong retrieved chunk, as it did in one fixture
519
- (`missing_post_key`) where the fix got redirected to a retrieved template
520
- instead of the view; the judge is shown the failing function's own
521
- source, which is the same source RAG-on's retriever draws from, so part
522
- of RAG-on's `no_fabrication` advantage may be judge and generator
523
- overlapping on material RAG-off never sees rather than RAG-on being more
524
- careful; and claim statuses are spot-checked, not exhaustively audited --
525
- a script that flagged 14 of 363 claims on one run, all correct on manual
526
- inspection, is a sample that turned up no false positive, not a proof
527
- that none exists. Full per-fixture results, the judge prompt, and how to
528
- reproduce this (about $1.37 for a `--runs 3` pass, most of it judge cost)
529
- are in [`evals/README.md`](evals/README.md).
499
+ The package can explain an error in two ways:
500
+
501
+ - **RAG-off (default):** the model sees only the Django traceback.
502
+ - **RAG-on:** the model also sees relevant source code from your project, retrieved from a local index.
503
+
504
+ The eval harness in `evals/` tests whether RAG-on explanations are more accurate, not just longer. It triggers 15 deliberately broken Django views, explains each one both ways, and has a separate judge model compare the two against the error's known cause and fix location. The judge doesn't know which explanation used RAG, and their order is randomized.
505
+
506
+ **Results (3 runs, 43 scored comparisons):** RAG-on won 35, RAG-off won 5, and 3 tied.
507
+
508
+ Most of the gap comes from two checks, measured on the 10 fixtures whose cause is in the app's own code (30 comparisons):
509
+
510
+ - **Points to the right file and function:** RAG-on 26, RAG-off 13
511
+ - **Avoids invented details:** RAG-on 26, RAG-off 17
512
+
513
+ Without your source, gpt-4o-mini tends to invent a plausible function name or parameter rather than admit it doesn't know. With the real code in front of it, it mostly doesn't.
514
+
515
+ **Limitations:**
516
+
517
+ - RAG can retrieve the wrong code. In one fixture (`missing_post_key`), it pointed the fix at a template instead of the view.
518
+ - The judge checks claims against the same source RAG-on retrieves from, which may inflate RAG-on's score for avoiding invented details.
519
+ - Claims are spot-checked, not fully audited. All 14 claims flagged on one run held up on manual review, but that is a sample, not proof.
520
+
521
+ Full results, methodology, and how to reproduce (about $1.37 per `--runs 3` pass) are in [evals/README.md](https://github.com/topunix/django-explain-errors/blob/main/evals/README.md).
530
522
 
531
523
  ## License
532
524
 
533
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
525
+ This project is licensed under the MIT License. See the [LICENSE](https://github.com/topunix/django-explain-errors/blob/main/LICENSE) file for details.
534
526
 
535
527
  ## Contributing
536
528
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-explain-errors
3
- Version: 0.9.2
3
+ Version: 0.9.3
4
4
  Summary: Django middleware that explains unhandled exceptions in DEBUG using an LLM, optionally grounded in your own project source via a local vector index. Works with OpenAI, Claude, or any OpenAI-compatible endpoint including local models.
5
5
  Home-page: https://github.com/topunix/django-explain-errors
6
6
  Author: topunix
@@ -546,41 +546,33 @@ django.db.utils.IntegrityError: NOT NULL constraint failed: blog_post.author_id
546
546
 
547
547
  ### Does RAG actually help?
548
548
 
549
- To check whether RAG-grounded explanations are actually better, not just
550
- longer, the package ships an eval harness (`evals/`): fifteen deliberately
551
- broken Django views, each explained twice (once from the traceback alone,
552
- once with RAG enabled) and judged by a separate model, blind to which
553
- explanation is which, against the error's known cause and correct fix
554
- location. Which side the judge sees as "A" is randomized per comparison so
555
- position can't bias the result.
556
-
557
- Across three runs (45 judged comparisons, 2 judge failures, 43 scored),
558
- RAG-on won 35, RAG-off 5, and 3 tied. The gap isn't spread evenly across
559
- everything the judge checks. It's concentrated in whether the explanation
560
- names the right file and function, and whether it invents details along
561
- the way: on `points_to_fix_location`, RAG-on answered yes in 26 of the
562
- group-A comparisons against RAG-off's 13; on `no_fabrication`, 26 against
563
- 17. Without source access, `gpt-4o-mini` tends to invent a
564
- plausible-sounding function name or parameter rather than say it doesn't
565
- know; given the actual code via RAG, it mostly does not.
566
-
567
- Three limitations are worth knowing before trusting this uncritically: RAG
568
- can anchor on the wrong retrieved chunk, as it did in one fixture
569
- (`missing_post_key`) where the fix got redirected to a retrieved template
570
- instead of the view; the judge is shown the failing function's own
571
- source, which is the same source RAG-on's retriever draws from, so part
572
- of RAG-on's `no_fabrication` advantage may be judge and generator
573
- overlapping on material RAG-off never sees rather than RAG-on being more
574
- careful; and claim statuses are spot-checked, not exhaustively audited --
575
- a script that flagged 14 of 363 claims on one run, all correct on manual
576
- inspection, is a sample that turned up no false positive, not a proof
577
- that none exists. Full per-fixture results, the judge prompt, and how to
578
- reproduce this (about $1.37 for a `--runs 3` pass, most of it judge cost)
579
- are in [`evals/README.md`](evals/README.md).
549
+ The package can explain an error in two ways:
550
+
551
+ - **RAG-off (default):** the model sees only the Django traceback.
552
+ - **RAG-on:** the model also sees relevant source code from your project, retrieved from a local index.
553
+
554
+ The eval harness in `evals/` tests whether RAG-on explanations are more accurate, not just longer. It triggers 15 deliberately broken Django views, explains each one both ways, and has a separate judge model compare the two against the error's known cause and fix location. The judge doesn't know which explanation used RAG, and their order is randomized.
555
+
556
+ **Results (3 runs, 43 scored comparisons):** RAG-on won 35, RAG-off won 5, and 3 tied.
557
+
558
+ Most of the gap comes from two checks, measured on the 10 fixtures whose cause is in the app's own code (30 comparisons):
559
+
560
+ - **Points to the right file and function:** RAG-on 26, RAG-off 13
561
+ - **Avoids invented details:** RAG-on 26, RAG-off 17
562
+
563
+ Without your source, gpt-4o-mini tends to invent a plausible function name or parameter rather than admit it doesn't know. With the real code in front of it, it mostly doesn't.
564
+
565
+ **Limitations:**
566
+
567
+ - RAG can retrieve the wrong code. In one fixture (`missing_post_key`), it pointed the fix at a template instead of the view.
568
+ - The judge checks claims against the same source RAG-on retrieves from, which may inflate RAG-on's score for avoiding invented details.
569
+ - Claims are spot-checked, not fully audited. All 14 claims flagged on one run held up on manual review, but that is a sample, not proof.
570
+
571
+ Full results, methodology, and how to reproduce (about $1.37 per `--runs 3` pass) are in [evals/README.md](https://github.com/topunix/django-explain-errors/blob/main/evals/README.md).
580
572
 
581
573
  ## License
582
574
 
583
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
575
+ This project is licensed under the MIT License. See the [LICENSE](https://github.com/topunix/django-explain-errors/blob/main/LICENSE) file for details.
584
576
 
585
577
  ## Contributing
586
578
 
@@ -10,7 +10,7 @@ with open('README.md', encoding='utf-8') as f:
10
10
 
11
11
  setup(
12
12
  name='django-explain-errors',
13
- version='0.9.2',
13
+ version='0.9.3',
14
14
  packages=find_packages(exclude=['tests', 'tests.*', 'evals', 'evals.*']),
15
15
  description='Django middleware that explains unhandled exceptions in DEBUG using an LLM, optionally grounded in your own project source via a local vector index. Works with OpenAI, Claude, or any OpenAI-compatible endpoint including local models.',
16
16
  long_description_content_type='text/markdown',