Harden issue-intent confidence handling in safe-output ingestion#43168
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens “issue intent” safe-output ingestion so malformed optional rationale / confidence metadata no longer causes otherwise-valid set_issue_type / set_issue_field (and structured label) outputs to be dropped during NDJSON collection. It also updates the generated tool-description INTENT suffix to specify the expected types for these optional fields.
Changes:
- Make issue-intent enrichment fields (
rationale,confidence) lenient by stripping them when malformed instead of rejecting the entire safe-output item. - Update structured-label validation to ignore invalid
rationale/confidencevalues while preserving the rest of each label entry. - Add regression tests for the updated INTENT suffix, stripping behavior, and NDJSON preservation.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/safe_output_type_validator.cjs | Implements lenient stripping for invalid optional issue-intent fields and structured-label normalization changes. |
| actions/setup/js/safe_output_type_validator.test.cjs | Adds validator regression coverage for structured labels and top-level stripping behavior. |
| actions/setup/js/generate_safe_outputs_tools.cjs | Updates the generated INTENT guidance text for issue-intent-aware tools. |
| actions/setup/js/generate_safe_outputs_tools.test.cjs | Updates tests to assert the new INTENT suffix string. |
| actions/setup/js/collect_ndjson_output.test.cjs | Adds NDJSON ingestion regression coverage to ensure valid items are preserved after stripping invalid intent fields. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Low
| /** | ||
| * Optional issue-intent enrichment fields should be stripped rather than causing | ||
| * the entire safe-output item to be rejected when they are malformed. | ||
| * @param {string} fieldName | ||
| * @param {FieldValidation} validation | ||
| * @returns {boolean} | ||
| */ | ||
| function shouldStripInvalidIssueIntentField(fieldName, validation) { | ||
| return !validation.required && LENIENT_ISSUE_INTENT_FIELDS.has(fieldName); | ||
| } |
| // Handle enum validation | ||
| if (validation.enum) { | ||
| const normalizedValue = value.toLowerCase ? value.toLowerCase() : value; | ||
| const normalizedEnum = validation.enum.map(e => (e.toLowerCase ? e.toLowerCase() : e)); | ||
| if (!normalizedEnum.includes(normalizedValue)) { | ||
| if (shouldStripInvalidIssueIntentField(fieldName, validation)) { | ||
| return { isValid: true, removeField: true }; | ||
| } |
|
@copilot please run the
|
Done. I ran a PR-finisher pass and validated readiness on
Since agent pushes do not re-trigger CI, a maintainer should re-run/re-trigger checks after any refresh/update to confirm green status on the final head. |
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #43168 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100). |
|
🧠 Matt Pocock Skills Reviewer failed during the skills-based review. |
|
✅ Test Quality Sentinel completed test quality analysis. |
🤖 PR Triage
Score Breakdown
Batch candidate with #43169. Both are defensive safe-output pipeline fixes.
|
|
@copilot please run the
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Addressed unresolved review feedback in
Branch status against I can’t reliably rerun CI on the updated head from this agent context; please re-trigger checks from the PR UI (or via maintainer push/workflow dispatch) to validate the latest commit. |
|
@copilot please run the
|
…intent-confidence-handling Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Completed a fresh PR-finisher pass.
CI for the current agent-pushed HEAD is still unverified until a maintainer re-triggers workflows from the PR UI (close/reopen, workflow_dispatch, or maintainer push). |
|
@copilot please run the
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Addressed the remaining actionable validator review feedback in Checks rerun locally:
I also reviewed prior CI runs via MCP logs; current PR-head CI is pending/stale after agent push and needs a maintainer re-trigger from the PR UI. |
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in
|
|
@copilot review all fields starting with "x-" and make sure there are on 2 concepts of field synonims/alises. Refactor and unify. Simplify changes. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed in
Targeted checks passed ( |
Issue-intent safe outputs were too brittle: malformed optional
confidence/rationalemetadata could cause otherwise validset_issue_typeandset_issue_fieldcalls to be dropped during NDJSON ingestion. This change makes intent guidance more explicit and treats invalid optional intent metadata as removable enrichment instead of a hard failure.Clarify issue-intent tool guidance
rationaleas a stringconfidenceas a string enum:LOW | MEDIUM | HIGHMake optional intent metadata lenient
rationale/confidencefrom:set_issue_typeset_issue_fieldrationale/confidencefrom issue-intent label payloadsAdd regression coverage
Example of the new behavior:
{"type":"set_issue_field","field_name":"Priority","value":"P1","confidence":"0.95","rationale":{"why":"bad"}}Now ingests as:
{"type":"set_issue_field","field_name":"Priority","value":"P1"}instead of rejecting the entire message.