feat(python): add neutrosophic phase 1 core#504
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e3c7e4598
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not math.isfinite(confidence_value): | ||
| raise ValueError("confidence must be finite") | ||
|
|
||
| confidence_value = _clamp(confidence_value) |
There was a problem hiding this comment.
Reject out-of-range classifier confidence
When a classifier returns a malformed confidence outside the documented 0–1 range, this clamp silently turns it into an extreme certainty instead of surfacing the bad value; for example, score_classifier_confidence(2, selected=True) becomes Triplet(T=1, I=0, F=0). Since the downstream decision helper treats high truth/low indeterminacy as confident, an invalid model output can be promoted to the strongest possible route rather than being handled as bad/uncertain input.
Useful? React with 👍 / 👎.
Summary
This opens the RFC's Phase 1 as a standalone upstream PR.
Scope in this PR is intentionally limited to a dependency-free Python neutrosophic core:
Triplet(T, I, F)value object with validationWhy this scope
Issue #484 proposes a staged path. This PR only covers the smallest reviewable primitive before any classifier, supervisor, orchestrator, or TypeScript integration work.
That keeps the review surface narrow and makes it easier to answer the first maintainer question:
Included
python/src/agent_squad/neutrosophic/*python/src/tests/neutrosophic/*Explicitly not included
NeutrosophicSupervisorroute_request(..., use_neutrosophic=True)integrationValidation
Run locally from
python/:Current result:
33 passedruff check: passedruff format --check: passedNotes
I also backported two core-only hardening fixes before opening this PR:
ValueErrorRelated RFC: #484