feat(enterprise): assemble governed calibration bundles - #543
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR adds a governed enterprise issue calibration bundle assembler. It validates bounded execution tuples, replays provenance, creates shared rating records, delegates bundle validation, exposes public symbols, and adds deterministic and adversarial tests. ChangesEnterprise issue calibration bundle
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant EnterpriseIssueAdapter
participant SharedCalibrationBuilder
Caller->>EnterpriseIssueAdapter: Provide bounded execution tuples
EnterpriseIssueAdapter->>EnterpriseIssueAdapter: Validate tuple shape and replay provenance
EnterpriseIssueAdapter->>SharedCalibrationBuilder: Pass flattened rating records and policy
SharedCalibrationBuilder-->>EnterpriseIssueAdapter: Return ScoringFacetsCalibrationBundle
EnterpriseIssueAdapter-->>Caller: Return calibration bundle
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@python/fast_mlsirm/scoring/enterprise_issue/calibration.py`:
- Around line 271-294: Update the calibration flow around the execution loop and
build_scoring_facets_calibration_bundle() to pass a lazy generator of
replay-validated records instead of materializing records with a list and
records.extend. Preserve tuple validation and record construction while ensuring
the shared builder enforces MAX_SCORING_FACETS_RATINGS before all derived
records are allocated, and add a regression test covering a small execution
limit with multiple records produced per execution.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3f87c6b5-24c7-41be-ac5a-560ced5782d6
📒 Files selected for processing (7)
CHANGELOG.mddocs/changelog.d/enterprise-issue-calibration-bundle.mddocs/doctoring/enterprise-issue-facets-handoff.mddocs/enterprise_issue_facets_calibration_handoff.mdpython/fast_mlsirm/scoring/enterprise_issue/__init__.pypython/fast_mlsirm/scoring/enterprise_issue/calibration.pytests/test_scoring_enterprise_issue_calibration_bundle.py
|
@coderabbitai review @opencode-agent @cwl-noema-review Final exact-head review requested for |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
requested_sha="a1d11635818528a52d0c379958947d27e7e7806e"
echo "== Checked-out commit =="
git rev-parse HEAD
echo "== Requested commit availability =="
git cat-file -t "$requested_sha"
echo "== Commit metadata =="
git show -s --format='%H%n%P%n%s' "$requested_sha"
echo "== Changed files at requested commit =="
git diff-tree --no-commit-id --name-status -r "$requested_sha"
echo "== Implementation outline =="
ast-grep outline python/fast_mlsirm/scoring/enterprise_issue/calibration.py --items all --view expanded
echo "== Implementation =="
cat -n python/fast_mlsirm/scoring/enterprise_issue/calibration.py
echo "== Enterprise issue package exports =="
cat -n python/fast_mlsirm/scoring/enterprise_issue/__init__.py
echo "== Bundle assembler tests =="
cat -n tests/test_scoring_enterprise_issue_calibration_bundle.py
echo "== Shared bundle builder and record bounds references =="
rg -n -C 4 \
'def (build_scoring_facets_calibration_bundle|build_enterprise_issue_facets_rating_records)|MAX_.*(RATING|CALIBRATION)|ScoringFacetsCalibrationBundle' \
python tests
echo "== Documentation and changelog changes =="
git diff "$requested_sha^" "$requested_sha" -- \
CHANGELOG.md \
docs/changelog.d/enterprise-issue-calibration-bundle.md \
docs/doctoring/enterprise-issue-facets-handoff.md \
docs/enterprise_issue_facets_calibration_handoff.md
echo "== Pull request metadata, checks, reviews, and comments =="
gh pr view 543 --repo ContextualWisdomLab/fast-mlsirm --json headRefOid,statusCheckRollup,reviews,comments
echo "== Open review threads =="
gh api graphql -F owner=ContextualWisdomLab -F name=fast-mlsirm -F number=543 -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
comments(first: 10) { nodes { author { login } body path line } }
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)'Length of output: 76287 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Failed Python CI job log =="
gh run view 30975575201 --repo ContextualWisdomLab/fast-mlsirm --job 92208747655 --log-failed
echo "== Bounded collection implementation =="
ast-grep outline python/fast_mlsirm/scoring/_contract_safety.py --items all --view expanded
rg -n -A80 -B10 '^def bounded_values\b' python/fast_mlsirm/scoring/_contract_safety.py
echo "== Installed shared calibration validation boundary =="
sed -n '1,120p' python/fast_mlsirm/scoring/__init__.py
sed -n '300,360p' python/fast_mlsirm/scoring/_calibration_validation.py
sed -n '1100,1185p' python/fast_mlsirm/scoring/calibration.py
echo "== Full PR diff against merge base =="
base="$(git merge-base origin/main HEAD 2>/dev/null || git merge-base HEAD "$(
gh pr view 543 --repo ContextualWisdomLab/fast-mlsirm --json baseRefOid --jq .baseRefOid
)")"
git diff --check "$base" HEAD
git diff --find-renames --stat "$base" HEAD
git diff --find-renames "$base" HEAD -- \
CHANGELOG.md \
docs/changelog.d/enterprise-issue-calibration-bundle.md \
docs/doctoring/enterprise-issue-facets-handoff.md \
docs/enterprise_issue_facets_calibration_handoff.md \
python/fast_mlsirm/scoring/enterprise_issue/__init__.py \
python/fast_mlsirm/scoring/enterprise_issue/calibration.py \
tests/test_scoring_enterprise_issue_calibration_bundle.py
echo "== Test and coverage configuration =="
fd -HI '(^pyproject\.toml$|^pytest\.ini$|^setup\.cfg$|^tox\.ini$|^\.coveragerc$)' . -x sh -c 'echo "---- $1"; cat "$1"' sh {}
echo "== CI and repository-policy workflow definitions =="
fd -HI -t f .github/workflows -x sh -c 'echo "---- $1"; rg -n -C 3 "(python|rust|package|gpu|fuzz|Security|SAST|Noema|OpenCode|coverage|unresolved)" "$1"' sh {}Length of output: 80080
The installed The implementation otherwise meets the requested boundary checks. It validates bounded exact tuples, replays each tuple through Rust, package, GPU smoke, fuzz, CodeQL, SAST, Security Scan, Strix, Noema Review, and OpenCode Review passed. The failed Python gate blocks approval. You are interacting with an AI system. |
|
@coderabbitai review @opencode-agent @cwl-noema-review Final exact-head review requested for |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/fast-mlsirm"
sha="b4b579b43baade0732d877a8de7eaa85940cc822"
echo "== Exact head =="
printf 'checked-out: '; git rev-parse HEAD
printf 'requested: '; git rev-parse "$sha"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$sha"
echo "== Includes current origin/main =="
git fetch origin main --quiet
main_sha="$(git rev-parse origin/main)"
printf 'origin/main: %s\n' "$main_sha"
if git merge-base --is-ancestor "$main_sha" "$sha"; then
echo "includes_current_main=yes"
else
echo "includes_current_main=no"
fi
echo "== Changed files from merge base =="
base="$(git merge-base origin/main "$sha")"
printf 'merge_base: %s\n' "$base"
git diff --check "$base" "$sha"
git diff --name-status "$base" "$sha"
echo "== Enterprise calibration module outline and relevant implementation =="
ast-grep outline python/fast_mlsirm/scoring/enterprise_issue/calibration.py --items all --view expanded
rg -n -A130 -B15 \
'^(MAX_ENTERPRISE_ISSUE_CALIBRATION_EXECUTIONS|def build_enterprise_issue_facets_calibration_bundle|def build_enterprise_issue_facets_rating_records)' \
python/fast_mlsirm/scoring/enterprise_issue/calibration.py
echo "== Shared boundary and bounded iterable implementation =="
rg -n -A100 -B15 \
'^(MAX_SCORING_FACETS_RATINGS|def build_scoring_facets_calibration_bundle|def bounded_values)' \
python/fast_mlsirm/scoring/calibration.py \
python/fast_mlsirm/scoring/_contract_safety.py \
python/fast_mlsirm/scoring/_calibration_validation.py
echo "== Package exports =="
cat -n python/fast_mlsirm/scoring/enterprise_issue/__init__.py
echo "== Focused bundle tests =="
cat -n tests/test_scoring_enterprise_issue_calibration_bundle.py
echo "== New documentation and changelog =="
git diff --find-renames "$base" "$sha" -- \
CHANGELOG.md \
docs/changelog.d/enterprise-issue-calibration-bundle.md \
docs/doctoring/enterprise-issue-facets-handoff.md \
docs/enterprise_issue_facets_calibration_handoff.md
echo "== Pull request head and check statuses =="
gh pr view 543 --repo "$repo" --json headRefOid,baseRefOid,statusCheckRollup,reviews \
--jq '{headRefOid,baseRefOid,reviews:[.reviews[]|{author:.author.login,state}],checks:[.statusCheckRollup[]|{name,conclusion,status,workflowName}]}'
echo "== Unresolved non-outdated review threads =="
gh api graphql -F owner=ContextualWisdomLab -F name=fast-mlsirm -F number=543 -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
comments(first: 10) {
nodes { author { login } body path line }
}
}
}
}
}
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false and .isOutdated == false)]'Length of output: 86754 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/fast-mlsirm"
sha="b4b579b43baade0732d877a8de7eaa85940cc822"
echo "== PR head and aggregate checks =="
gh pr view 543 --repo "$repo" --json headRefOid,statusCheckRollup --jq \
'{headRefOid,checks:[.statusCheckRollup[]|{name,workflowName,status,conclusion,detailsUrl}]}'
echo "== Recent workflow runs for the exact head =="
gh run list --repo "$repo" --commit "$sha" --limit 100 \
--json databaseId,name,status,conclusion,headSha,event,workflowName,url \
--jq '.[] | {databaseId,name,workflowName,status,conclusion,headSha,event,url}'
echo "== Current unresolved non-outdated review threads =="
gh api graphql -F owner=ContextualWisdomLab -F name=fast-mlsirm -F number=543 -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
comments(first: 1) { nodes { author { login } body path line } }
}
}
}
}
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false and .isOutdated == false)]'Length of output: 10590
The branch includes current The implementation preserves deterministic order invariance and shared criterion, task-revision, respondent, and rater provenance. It adds no competing schema, fit logic, report logic, or psychometric arithmetic. The public exports, docstrings, doctoring, and changelog are consistent. There are no unresolved current-head review threads. I cannot approve yet. The exact-head You are interacting with an AI system. |
Summary
ScoringFacetsCalibrationBundleScope
This is the smallest post-#541 prerequisite slice for issue #404. It adds no enterprise-specific fit, report, ranking, utility, valuation, or decision schema and leaves fitting explicit through the existing
fit_scoring_facets_bundle()API.Closes no issue; advances #404.
Summary by CodeRabbit
New Features
Documentation
Tests