Skip to content

Fix Impact report objective mapping guidance to match resolver outputs and available datasets#39784

Merged
mnkiefer merged 6 commits into
mainfrom
copilot/fix-impact-report-statistics
Jun 17, 2026
Merged

Fix Impact report objective mapping guidance to match resolver outputs and available datasets#39784
mnkiefer merged 6 commits into
mainfrom
copilot/fix-impact-report-statistics

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Impact Efficiency Report statistics are now aligned with the actual deterministic dataset contract and resolver flow. Instead of requiring always-present pre-enriched objective fields, the workflow now uses linked deterministic inputs first and applies optional precomputed objective fields only when those enriched files are available.

Updated: objective-impact-report.md

  • Uses merged-prs-linked.json and closed-unmerged-prs-linked.json as the primary required PR inputs
  • Treats *-with-objective.json files as optional/enhanced inputs (used when present and non-empty)
  • Corrects safe-output-issue-evaluations.jsonl expectations to use it for deterministic outcome/workflow attribution (not precomputed objective fields)
  • Updates objective mapping and association rules to compute from traced linked/root issue labels when precomputed objective fields are unavailable
  • Keeps exclusion rules for PRs without linked closing issues (no PR-label fallback)
  • Human Work section now sources from merged-prs-linked.json, with optional enriched-objective fallback when available
  • Recompiled workflow lock file to reflect the prompt updates (objective-impact-report.lock.yml)

Copilot AI and others added 3 commits June 17, 2026 11:59
…r and objective mapping

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
…bjective mapping

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
…caping, use Set for label dedup

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — great work reworking the objective-value computation pipeline for the Impact Efficiency Report! Replacing the runtime regex/LLM label lookups with precomputed objective_value/objective_labels fields is a solid improvement, and the description is thorough.

One thing that would strengthen this before it's marked ready:

  • Add tests for prepare-objective-impact-pr-objective.cjs — this is a brand-new 390-line script that implements the JS equivalent of intent.Resolver.ResolvePullRequest (including the batch-GraphQL label fetch and computeObjectiveValue / getObjectiveLabels logic). A few unit-level test cases covering the happy path (PR with closing issue refs), the regex fallback path, and the objective value mapping would make the core logic easier to validate and refactor safely.

If you'd like a hand with that:

Add unit tests for scripts/prepare-objective-impact-pr-objective.cjs.
Cover the following scenarios:
1. A PR with `closingIssuesReferences` present — verify `attribution_source` is `'closing_issues'` and `objective_value`/`objective_labels` are populated correctly.
2. A PR with no closing issue refs but an issue URL in the body — verify `attribution_source` is `'body_regex'` and objective fields are populated.
3. A PR with no issue references at all — verify `objective_value` is 0 and `objective_labels` is empty.
4. `computeObjectiveValue` with a mixed label set — verify the sum matches the `ObjectiveMapping` entries.
Use a lightweight test runner (e.g. Node's built-in `node:test` or `jest`) consistent with any existing test setup in the scripts/ directory.

Generated by ✅ Contribution Check ·

@mnkiefer

Copy link
Copy Markdown
Collaborator

@copilot Only keep files impacted by the change, including objective-impact-report.md and its compiled version objective-impact-report.lock.yml and revert the rest.

…nd .lock.yml

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Only keep files impacted by the change, including objective-impact-report.md and its compiled version objective-impact-report.lock.yml and revert the rest.

Done — reverted the 13 unrelated .lock.yml files, removed scripts/prepare-objective-impact-pr-objective.cjs, and restored the two script files to their base state. Only objective-impact-report.md and objective-impact-report.lock.yml remain changed (commit Revert unrelated file changes; keep only objective-impact-report.md and .lock.yml).

Copilot AI requested a review from mnkiefer June 17, 2026 15:04
@mnkiefer mnkiefer marked this pull request as ready for review June 17, 2026 15:06
Copilot AI review requested due to automatic review settings June 17, 2026 15:06
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #39784 does not have the 'implementation' label (has_implementation_label=false) and has 0 new lines of code in business logic directories (default_business_additions=0, threshold=100).

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped. Changed files: .github/workflows/objective-impact-report.lock.yml, .github/workflows/objective-impact-report.md

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Objective Impact Efficiency Report workflow spec to stop computing objective values via live label lookups and instead consume precomputed objective attribution/value fields intended to come from the root-level intent resolver + objective mapping pipeline.

Changes:

  • Adds *-with-objective.json datasets as required deterministic inputs and changes PR attribution logic to read objective_value / objective_labels directly.
  • Rewrites the “Objective value mapping” and “Outcome association rules” sections to rely on precomputed fields (and to exclude PRs without linked closing issues).
  • Updates the compiled lockfile metadata hash to reflect the spec changes.
Show a summary per file
File Description
.github/workflows/objective-impact-report.md Reorients the report logic toward precomputed objective attribution/value fields and updates required inputs and association rules accordingly.
.github/workflows/objective-impact-report.lock.yml Regenerates workflow lock metadata (body hash) for the updated markdown spec.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 4

Comment thread .github/workflows/objective-impact-report.md Outdated
Comment thread .github/workflows/objective-impact-report.md Outdated
Comment thread .github/workflows/objective-impact-report.md Outdated
Comment thread .github/workflows/objective-impact-report.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mnkiefer

Copy link
Copy Markdown
Collaborator

@copilot Address all remaining copilot review comments for the .md file and recompile the workflow.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnose and /grill-with-docs — requesting changes on one correctness gap in the fallback path, plus three precision issues in the new rules.

📋 Key Themes & Highlights

Key Themes

  • Broken fallback path: The PR removes objective-mapping.json computation instructions but adds a fallback to merged-prs-linked.json — a file that doesn't contain precomputed objective values. An agent following the fallback path has no instructions for computing objective_value, risking silent wrong results.
  • Stale model definition: The Objective Value = definition block (line 78) still describes live computation from labels, contradicting the new precomputed approach.
  • Ambiguous zero-value classification: The objective_value === 0 rule conflates null/absent/empty-array with a semantically different state, potentially misclassifying entries.
  • Rule precedence not stated: Rules 2 and 5 in "Outcome association rules" can logically conflict for certain entries; the evaluation order should be explicit.

Positive Highlights

  • ✅ Excellent root-cause fix: replacing live regex/LLM lookups with deterministic precomputed fields eliminates a major source of statistical drift
  • attribution_source: "none" exclusion is explicitly documented — no ambiguity on the "exclude vs. fall back to PR labels" question
  • ✅ The new fallback instruction (line 154) is a good safety net; it just needs the missing objective-computation guidance
  • ✅ Clear separation between PR outcomes and safe-output issue outcomes throughout

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

Comments that could not be inline-anchored

.github/workflows/objective-impact-report.md:154

[/diagnose] Fallback path is missing objective computation guidance — if *-with-objective.json files are absent, the agent has no instructions for deriving objective_value from the older merged-prs-linked.json files.

<details>
<summary>💡 Explanation and suggested fix</summary>

The PR removes the only instructions for computing Objective Value from objective-mapping.json (the pseudo-code mapping.ComputeObjectiveValue(root_labels) block is gone). When the fallback kicks in, an …

.github/workflows/objective-impact-report.md:78

[/diagnose] The model definition on this line is now stale — it says Objective Value = ... objective-mapping configuration applied to traced root labels, but after this PR objective values are read from precomputed fields, not computed live.

<details>
<summary>💡 Suggested update</summary>

Update the model definition block to reflect the new precomputed approach:

Objective Value = precomputed field from *-with-objective.json (or safe-output-issue-evaluations.jsonl for issue outcomes…

</details>

<details><summary>.github/workflows/objective-impact-report.md:140</summary>

**[/diagnose]** The `objective_value === 0` disambiguation rule has an edge case: an empty array `root_issue_labels: []` is technically &quot;present&quot; in JSON but contains no labels, so the condition `has root_issue_labels or labels present` and `no root labels at all` can yield opposite results for the same logical state.

&lt;details&gt;
&lt;summary&gt;💡 Suggested clarification&lt;/summary&gt;

Be explicit about what &quot;present&quot; means:

If objective_value is 0:

  • root_issue_labels is null, absent, or empty arra…
.github/workflows/objective-impact-report.md:152

[/diagnose] Rule 2 (exclude attribution_source: &quot;none&quot;) and Rule 5 (objective_value === 0 with labels → unmapped) have an implicit ordering that isn't stated — a PR with attribution_source: &quot;none&quot; could theoretically also have root_issue_labels present (e.g., pre-populated from the PR itself), triggering both rules.

<details>
<summary>💡 Suggested clarification</summary>

Add an explicit evaluation order note such as:
> "Evaluate exclusion rules (Rule 2) before classification rules…

.github/workflows/objective-impact-report.md:137

[/grill-with-docs] Only two attribution_source values are documented (&quot;closing_issue&quot; and &quot;none&quot;), but if the Go implementation ever emits a third value (or if a future schema revision adds one), agents will silently mishandle those entries with no guidance.

<details>
<summary>💡 Suggested addition</summary>

Add an explicit catch-all rule:

- For any other attribution_source value: treat as &quot;none&quot; (exclude from analysis).

Or, if the enum is guaranteed exhaustive in the curre…

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES — spec commits to a data contract that does not exist yet and the fallback path is broken.

Blocking themes

Data contract mismatch (4 existing issues, not repeated here)

The existing review (copilot-pull-request-reviewer) already captured four correctness issues: *-with-objective.json files are not produced by the current dataset generator; safe-output-issue-evaluations.jsonl does not currently emit objective_value/objective_labels/attribution_source; the attribution_source: "artifact_labels" case is silently unhandled; and root_issue_numbers/root_issue_labels are not present in the current PR datasets. Those remain unresolved and blocking.

New issues found in this pass

  1. objective_value == 0 is an unsafe unmapped proxy (line 140) — if any label in the objective mapping legitimately resolves to 0, those outcomes are silently mislabeled. An explicit unmapped: true boolean in the precomputed schema would be safer.

  2. Broken fallback path (line 154) — the *-linked.json fallback files have no objective_value/objective_labels fields, and this PR removed all instructions for live objective computation. If the fallback fires, the agent silently produces a report with zero objective attribution and no error.

  3. zizmor: ignore annotation displaced in lock.yml (lock.yml line 1637) — the suppression comment was moved off the run: key line onto a preceding standalone line, which zizmor does not recognize as a suppression. This is likely to break the CI security scan.

🔎 Code quality review by PR Code Quality Reviewer

Comments that could not be inline-anchored

.github/workflows/objective-impact-report.md:140

objective_value == 0 is an unreliable proxy for "unmapped" — if any label in the objective mapping legitimately resolves to value 0, those outcomes will be silently mislabeled.

<details>
<summary>💡 Suggested fix</summary>

The rule "objective_value is 0 AND labels present → unmapped" implicitly assumes that no label in .github/objective-mapping.json maps to value 0. If a label category (e.g., wontfix, chore) is explicitly assigned value 0 in the mapping, those outcomes will be fal…

.github/workflows/objective-impact-report.md:154

The fallback to *-linked.json is a dead end — those files lack the precomputed objective fields, and this spec no longer retains any instructions for computing them live.

<details>
<summary>💡 Why this silently breaks</summary>

When *-with-objective.json files are missing or empty, the spec says to fall back to merged-prs-linked.json / closed-unmerged-prs-linked.json. But:

  1. Those files only contain linked_issue_numbers; they have no objective_value, objective_labels, `root_is…
.github/workflows/objective-impact-report.lock.yml:1637

The zizmor: ignore annotation was moved off the run: key line to a standalone preceding comment; this likely breaks the suppression and will cause CI to start failing.

<details>
<summary>💡 Details</summary>

Previously the suppression was inline:

run: | # zizmor: ignore[github-env] - GITHUB_SERVER_URL is set by GitHub Actions, not user input.

Now it is a standalone comment on the line above:

# zizmor: ignore[github-env] - GITHUB_SERVER_URL is set by GitHub Actions, no…

</details>

<details><summary>.github/workflows/objective-impact-report.md:64</summary>

`root_issue_labels` is listed as a field in `safe-output-issue-evaluations.jsonl`, but that field only exists for PR records — safe-output issues are resolved via `ResolveIssue()` with no root-issue tracing.

&lt;details&gt;
&lt;summary&gt;💡 Details&lt;/summary&gt;

Line 64 asserts that `safe-output-issue-evaluations.jsonl` contains `root_issue_labels`. But this field is the output of `ResolvePullRequest()`, which traces a PR to its linked closing issue and attaches that issue&#39;s labels. Safe-output issues are r…

</details>

<details><summary>.github/workflows/objective-impact-report.md:137</summary>

The exclusion rules only handle `attribution_source: &quot;closing_issue&quot;` and `&quot;none&quot;`, but the resolver also emits `&quot;ambiguous&quot;` for PRs with multiple closing issues — those are silently miscounted as &quot;no linked issue.&quot;

&lt;details&gt;
&lt;summary&gt;💡 Details&lt;/summary&gt;

`intent.Resolver.ResolvePullRequest` has a third outcome: when a PR has multiple `closingIssuesReferences`, the ambiguous path fires and returns an `IntentRecord` with `attribution_source: &quot;ambiguous&quot;`, `Status: &quot;ambiguous&quot;`, and no populat…

</details>

<details><summary>.github/workflows/objective-impact-report.md:149</summary>

The exclusion condition &quot;entry has no `root_issue_numbers`&quot; is ambiguous between an absent field and an empty array `[]`, leading to opposite outcomes for ambiguous-attribution PRs.

&lt;details&gt;
&lt;summary&gt;💡 Details&lt;/summary&gt;

The dataset-build script can serialize a PR with no resolved root issues as either:
- `&quot;root_issue_numbers&quot;: []` (empty array present), or
- the field entirely absent from the record

&quot;Has no `root_issue_numbers`&quot; is ambiguous across these two representations. If the agent t…

</details>

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Address all remaining copilot review comments for the .md file and recompile the workflow.

Addressed in dcfd992.

I updated .github/workflows/objective-impact-report.md to match the current dataset generator contract (removed non-generated required *-with-objective.json inputs, corrected safe-output field expectations, and switched PR association instructions to linked_issue_numbers with optional precomputed/enriched fallback), then recompiled to update .github/workflows/objective-impact-report.lock.yml.

Copilot AI changed the title Fix Impact report statistics to use outcome root-level resolver and objective mapping Fix Impact report objective mapping guidance to match resolver outputs and available datasets Jun 17, 2026
Copilot AI requested a review from mnkiefer June 17, 2026 15:31
@mnkiefer mnkiefer merged commit a2c6694 into main Jun 17, 2026
32 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-impact-report-statistics branch June 17, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants