Skip to content

Record outcome and deciding actor for bot-resolved issues and PRs in logs --adoption - #79255

Merged
mnkiefer merged 7 commits into
mainfrom
copilot/fix-automation-decision-logs
Nov 19, 2026
Merged

mnkiefer merged 7 commits into
mainfrom
copilot/fix-automation-decision-logs

Conversation

@mnkiefer

@mnkiefer mnkiefer commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

observeLifecycleProposal returned lifecycle / automation_decision as soon as the deciding actor was a bot, before checking whether the PR was merged or the issue was completed. Bot-merged and bot-closed outputs therefore produced identical records, so workflows whose PRs bots merge (e.g. daily-doc-updater) had no recoverable acceptance outcome.

This change records the outcome and the deciding actor. Value attribution is unchanged and still requires explicit_human.

 "adoption": {
-  "state": "lifecycle", "signal": "automation_decision"
+  "state": "accepted", "signal": "merged", "acceptance_kind": "automation",
+  "actor": {"login": "github-actions[bot]", "type": "Bot"}, "human_verified": false
 }

Changes

  • Lifecycle model (pkg/lifecycle)

    • New Actor{Login, Type} on Adoption (actor,omitzero) and Observation.
    • Observe accepts acceptance_kind: automation. It rejects an automation decision that claims HumanVerified or has no actor login.
    • explicit_human does not require actor, so existing retained human records stay valid.
  • Proposal observer (pkg/cli/logs_lifecycle_adoption.go)

    • A bot decision with a visible login now records the resolution through lifecycleProposalResolution, the same mapping the human path uses.
    • The actor is recorded whenever a login is visible, on every path.
    Resolution state / signal
    PR merged accepted / merged
    PR closed unmerged rejected / closed_without_merge
    Issue closed completed accepted / completed
    Issue closed not_planned rejected / closed_not_planned
    Other close reason unknown / missing_resolution_reason
    Bot type with no login unknown / unverified_decision_actor
  • Summaries

    • New accepted_automation counter alongside accepted_human and accepted_delivery_fallback, also shown in the logs and operational-value text output.
  • Consumers

    • JS collectors (collect_lifecycle.cjs, prepare_objective_impact_lifecycle.cjs → automation_adopted_count) and the unified_session.d.ts enum.
    • Regenerated schemas/{audit,logs,logs-jsonl}.schema.json and unified-session.schema.json.
  • Docs and prompts

    • Spec rule in specs/safe-output-lifecycle.md.
    • Delivery-adoption reference, glossary, measuring-impact guide, and the new OTel attribute gh-aw.adoption.accepted_automation.
    • metrics-collector and objective-impact-report prompts; their lock files changed only in content hashes.

Reviewer notes

  • Behavior change: accepted, and the acceptance rate and zero-touch metrics derived from it, now include automation decisions. The value-attribution gates (operational_value_report.go, operational_value_evidence_report.go, operational_value_daily.go) are untouched and still require explicit_human with human_verified.
  • Legacy records:
    • Retained lifecycle / automation_decision records still validate.
    • They are replaced on the next 24h re-observation, because Merge keeps the newer ObservedAt.
    • The JSONL cache schema version is not bumped.
  • Out of scope:
    • The unified-session lifecycle.adoption event carries acceptanceKind but not actor.
    • The legacy outcome-evaluator conformance fixture (bot-closed issue → lifecycle) is unchanged. That path no longer produces create_issue / create_pull_request adoption records.

Copilot AI adaptive review requested due to automatic review settings November 19, 2026 12:18

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Test Quality Sentinel is analyzing test quality on this pull request...

@mnkiefer mnkiefer changed the title [WIP] Fix logs for bot merges and closures outcome Record outcome and deciding actor for bot-resolved issues and PRs in logs --adoption Nov 19, 2026
@mnkiefer

Copy link
Copy Markdown
Collaborator Author

@copilot Fix failing checks

Copilot AI commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@copilot Fix failing checks

Fixed the oversized metrics fixture by reducing its synthetic workflow count to 340 while preserving the 460,000-byte baseline. The focused tests and final local validation pass, and the latest CJS check is green. Commit: 2a076a9c.

@mnkiefer
mnkiefer merged commit 26e432d into main Nov 19, 2026
80 checks passed
@mnkiefer
mnkiefer deleted the copilot/fix-automation-decision-logs branch November 19, 2026 13:53
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.

logs --adoption: bot merges and closures are recorded as automation_decision without the merge outcome

3 participants