Skip to content

Unify Go and JavaScript outcome semantics and evidence rules - #67519

Merged
pelikhan merged 5 commits into
mainfrom
pelikhan-outcome-computation-status
Oct 10, 2026
Merged

pelikhan merged 5 commits into
mainfrom
pelikhan-outcome-computation-status

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The CLI and scheduled outcome collector classified identical safe outputs differently and could report acceptance from target existence or unrelated activity. This change gives both runtimes the same conservative, action-specific evidence contract.

Approach

  • Require attributable execution evidence for label changes, milestone assignments, submitted reviews, pushed commits, and agent-linked PRs. Open issues and PRs remain pending; existence-only and unsupported evaluations are unknown.
  • Distinguish primary-object deletion from supplementary API failures. Zero-touch requires complete effort evidence and counts all post-action non-bot commits, including the PR author's commits.
  • Compare label identity case-insensitively and reject malformed, fractional, unsafe, or nonpositive execution IDs.
  • Preserve normalized status, evidence strength, and signal through reports and telemetry, including unknown, error, and lifecycle counts.
  • Extract focused JavaScript modules and Go helpers. The shared conformance corpus now includes 77 cases, with direct JavaScript pagination/error transport tests.
  • Add a checksum-pinned TLA+ checker: 16,272 distinct baseline states, all shared fixture projections, and ten exact negative-control counterexamples. Bounded model checking is not a proof of arbitrary native execution.

Validation

Focused Go outcomes, the shared Go/JavaScript corpus, JavaScript transport tests, typechecking, and TLC checks pass. The final repository progress gate covers formatting, standard/custom lint, impacted unit tests, schemas, and workflow lock drift.

Architecture decision

ADR: ADR-67519: Unify Outcome Evidence Semantics Across the Go and JavaScript Runtimes

The completed proposal records the rationale, alternatives, compatibility impact, and formal-verification limits. Architectural acceptance remains subject to maintainer review.

Scope and compatibility

Existing manifests without required execution evidence may produce unknown rather than accepted. Generic existence checks no longer inflate acceptance, and stale open creations are not ignored merely because time elapsed. Collector revisit/retry scheduling and per-outcome AIC attribution are unchanged. The pre-existing docs link failure in experimental/drive-memory.md is unrelated to this change.

pelikhan and others added 3 commits October 10, 2026 14:42
Use conservative action-specific acceptance and shared conformance fixtures. Preserve execution identifiers and normalized evidence through collector summaries and telemetry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Extract action classification, attribution and summary helpers. Preserve permissive API field decoding through checked accessors and remove redundant evidence assignments.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 10, 2026 23:00
Copilot AI balanced review requested due to automatic review settings October 10, 2026 23:00
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

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

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

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #67519

@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.

One small opportunity to make the normalization table leaner.

net: -18 lines possible.

Generated by ✂️ Ponytail Reviewer for #67519 · codex · gpt56 · 17.6 AIC · ⌖ 5.08 AIC · ⊞ 13.5K
Comment /ponytail to run again

Comment thread actions/setup/js/evaluate_outcomes.cjs
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (1214 new lines across pkg/, actions/, and specs/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/67519-unify-outcome-evidence-semantics-across-runtimes.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff and body
  2. Complete the missing sections — add context the AI couldn't infer, refine the decision rationale, and confirm the alternatives listed reflect what you actually weighed (notably "collapse to a single runtime" vs. "shared conformance corpus")
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-67519: Unify Outcome Evidence Semantics Across the Go and JavaScript Runtimes

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

🔍 Evidence used
  • Enforcement trigger: default_business_additions = 1214 (> 100 threshold); no implementation label; no .design-gate.yml override.
  • No existing ADR found: PR body contains no ADR link or section, no fixes #N linked issue, and docs/adr/ contains no 67519-* file.
  • Decision inferred from: pkg/cli/outcome_eval_evidence.go (+107), actions/setup/js/outcome_evidence.cjs / outcome_action_evaluators.cjs / outcome_review_evaluators.cjs (+870), pkg/cli/testdata/outcome_conformance.json (+340, 63 shared cases), specs/outcomes/ TLA+ model (+828), and the rewrite of specs/safe-output-outcome-evaluation.md (+170/−283).
❓ Why ADRs Matter

ADRs create a searchable, permanent record of why the codebase looks the way it does. This PR is a deliberate behavioural break (accepted → unknown for manifests without execution evidence); future readers will need the rationale.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · opus50 · 50.2 AIC · ⌖ 50.8 AIC · ⊞ 1.8K · ◷
Comment /review to run again

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.

🟡 Changes recommended

Label casing, zero-touch accounting, identifier validation, and collector guidance can still produce incorrect classifications.

6 open findings
What changed in this PR

Unifies Go and JavaScript outcome classification with conservative evidence rules, shared conformance fixtures, telemetry updates, and a formal TLA+ model.

Changes:

  • Adds action-specific evidence evaluation and cross-runtime conformance coverage.
  • Preserves unknown, error, lifecycle, human-effort, and evidence-strength metrics.
  • Updates schemas, documentation, telemetry, and the scheduled collector.

Static workflow review found no security-control weakening; compilation and scanners were not independently rerun.

File Description
specs/​outcomes/​README.md Documents the formal model and verification.
specs/​outcomes/​OutcomeEvaluation.tla Defines outcome semantics and invariants.
specs/​outcomes/​OutcomeEvaluation.cfg Configures TLC checks.
specs/​outcomes/​check.mjs Runs formal checks and negative controls.
schemas/​logs-jsonl.schema.json Adds unknown summary counts.
schemas/​audit.schema.json Adds unknown audit counts.
pkg/​cli/​testdata/​outcome_conformance.json Provides shared conformance cases.
pkg/​cli/​outcome_evaluation.go Normalizes typed outcome evidence.
pkg/​cli/​outcome_eval.go Adds counting, pagination, and parsing helpers.
pkg/​cli/​outcome_eval_workflow.go Refines workflow dispatch outcomes.
pkg/​cli/​outcome_eval_workflow_test.go Updates unsupported discussion expectations.
pkg/​cli/​outcome_eval_update.go Uses typed retained-state results.
pkg/​cli/​outcome_eval_test.go Tests summary reconciliation and parsing.
pkg/​cli/​outcome_eval_review.go Adds attributable review classification.
pkg/​cli/​outcome_eval_pr.go Adds complete PR effort evidence.
pkg/​cli/​outcome_eval_label.go Verifies executed label deltas.
pkg/​cli/​outcome_eval_jsonl.go Exports human-review counts.
pkg/​cli/​outcome_eval_issue.go Refines issue lifecycle classification.
pkg/​cli/​outcome_eval_helpers.go Tightens actor and closure handling.
pkg/​cli/​outcome_eval_generic.go Adds evidence-specific generic evaluators.
pkg/​cli/​outcome_eval_formal_test.go Updates formal behavior tests.
pkg/​cli/​outcome_eval_evidence.go Adds shared evidence helpers.
pkg/​cli/​outcome_eval_comment.go Refines comment engagement evaluation.
pkg/​cli/​outcome_eval_agent.go Requires attributable agent PRs.
pkg/​cli/​outcome_conformance_test.go Tests Go against shared fixtures.
docs/​src/​content/​docs/​reference/​outcomes.md Documents revised semantics.
actions/​setup/​js/​safe_output_manifest.test.cjs Tests persisted execution identities.
actions/​setup/​js/​safe_output_manifest.cjs Persists milestone and commit identities.
actions/​setup/​js/​outcome_types.d.ts Defines JavaScript outcome results.
actions/​setup/​js/​outcome_review_evaluators.cjs Implements review/update evaluators.
actions/​setup/​js/​outcome_evidence.cjs Adds JavaScript evidence helpers.
actions/​setup/​js/​outcome_conformance.test.cjs Tests JavaScript conformance.
actions/​setup/​js/​outcome_action_evaluators.cjs Implements action-specific evaluation.
actions/​setup/​js/​evaluate_outcomes.test.cjs Consolidates evaluator tests.
actions/​setup/​js/​emit_outcome_spans.test.cjs Tests expanded telemetry.
actions/​setup/​js/​emit_outcome_spans.cjs Exports new outcome attributes.
.github/​workflows/​outcome-collector.md Updates collector reporting semantics.
.github/​workflows/​outcome-collector.lock.yml Regenerates workflow metadata.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread actions/setup/js/outcome_action_evaluators.cjs Outdated
Comment thread actions/setup/js/outcome_action_evaluators.cjs
Comment thread pkg/cli/outcome_eval_label.go Outdated
Comment thread pkg/cli/outcome_eval_pr.go Outdated
Comment thread pkg/cli/outcome_eval_review.go Outdated
Comment thread .github/workflows/outcome-collector.md
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-10T23:04:02.953+00:00
review_event: REQUEST_CHANGES
top_themes:
  - cross-runtime parity regression in submit_pull_request_review telemetry
files_reviewed:
  - actions/setup/js/outcome_action_evaluators.cjs
  - actions/setup/js/outcome_review_evaluators.cjs
  - actions/setup/js/evaluate_outcomes.cjs
  - actions/setup/js/emit_outcome_spans.cjs
  - pkg/cli/outcome_eval_review.go
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 122.5 AIC · ⌖ 5.65 AIC · ⊞ 20.1K · ◷
Comment /review to run again

@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 /codebase-design and /tdd — commenting with minor non-blocking suggestions on an otherwise well-constructed unification effort.

📋 Key Themes & Highlights

Key Themes

  • Minor internal duplication (Go): outcomeCloseActor (outcome_eval_evidence.go) and isLatestCloseByBot (outcome_eval_helpers.go) implement nearly identical bot-close detection; consolidating would reinforce the parity goal of this PR.
  • Brittle string-matching for persistent-404 classification (JS): outcome_action_evaluators.cjs's catch block reconstructs expected endpoint strings per type rather than having evaluators mark their primary fetch explicitly.
  • Test gap on the new ghAPI pagination/error wrapper: the rewritten ghAPI() (now load-bearing for "deleted" classification via HTTP-status parsing) has no direct unit test, unlike its Go counterpart which is covered by TestOutcomeAPIArrayPagination.

Positive Highlights

  • ✅ Excellent cross-runtime discipline: 63 shared conformance fixtures (pkg/cli/testdata/outcome_conformance.json) consumed by both the Go test suite and outcome_conformance.test.cjs is a strong parity guardrail.
  • ✅ Clean extraction of outcome_action_evaluators.cjs, outcome_review_evaluators.cjs, and outcome_evidence.cjs from the 1800-line monolith — each evaluator is now independently readable.
  • ✅ TLA+ formal spec (specs/outcomes/OutcomeEvaluation.tla) with a model-checking runner is a rigorous addition for an evidence-classification system with this many branches.
  • ✅ Documentation (outcome-collector.md, docs/reference/outcomes.md) was updated in lockstep with the new unknown/error/lifecycle statuses — no drift between behavior and docs.

Note on diff truncation

The pre-fetched diff was capped at 3000 lines and only covered .github/workflows/outcome-collector.md, emit_outcome_spans.cjs/test, and the start of evaluate_outcomes.cjs/test. I read the remaining high-impact files (outcome_action_evaluators.cjs, outcome_review_evaluators.cjs, outcome_evidence.cjs, the Go pkg/cli/outcome_eval_*.go files, and the conformance fixtures) directly from the checked-out tree to complete this review, and confirmed go build ./pkg/cli/... succeeds. JS tests could not be executed in this sandbox (npm registry blocked by a self-signed-cert proxy), so JS findings are based on static reading of the refactored modules and existing test files rather than a live test run.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 260.9 AIC · ⌖ 15 AIC · ⊞ 10.3K
Comment /matt to run again

Comment thread pkg/cli/outcome_eval_evidence.go
Comment thread actions/setup/js/outcome_action_evaluators.cjs Outdated
Comment thread actions/setup/js/evaluate_outcomes.cjs
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan merged commit 45ba78a into main Oct 10, 2026
117 checks passed
@pelikhan
pelikhan deleted the pelikhan-outcome-computation-status branch October 10, 2026 23:44
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.

2 participants