Skip to content

friction: reject stale issue-audit producer revisions before label writes #8307

Description

@ll7

Archetype Metadata

archetype: workflow
evidence_tier: smoke
linked_policy:
  - docs/context/issue_audit_contract.md
  - docs/maintainer_values.md

Goal / Problem

Observed behavior

On 2026-09-02, one writer using the shared ll7 GitHub credential added
decision-required to 21 already-ruled open issues in a sequential batch between
20:15:43 and 20:16:45 UTC:

#3207, #3287, #6155, #7290, #7382-#7388, #7409, #7411, #7412,
#7457, #7980, #8021, #8064, #8076, #8172, and #8173.

The current-main classifier at aa69d7cdc2150023fca1cf805772807ea1575a85 subsequently read every
complete REST thread and returned decision_required: false with empty decision evidence for all
21. Each issue already had a controlling same-issue ruling or evidence-required/tracker
disposition. A maintainer pass removed only the false label and preserved all independent state,
dependency, domain, evidence, release, and external-input gates.

GitHub timeline events identify only the shared account, not the producing task, worktree, source
revision, or classifier version. The exact producer is therefore unknown. The strongest current
hypothesis, at roughly 80% confidence, is a long-lived worker using pre-fix audit logic or an
alternate write path that did not carry the current ruling regressions. This issue must not assume
that attribution as fact.

Expected behavior

An autonomous issue-audit writer must prove which source and plan produced a label mutation, and it
must fail closed before writing when its audit implementation is stale relative to fetched
origin/main, when the apply-time source differs from the plan-time source, or when producer
identity/provenance is unavailable. Current same-issue ruling suppression and genuine later-reopen
semantics must remain intact.

Parent issue

Reproduction / Evidence

  1. Inspect the issue timeline events for the first and last affected rows:

    gh api --paginate repos/ll7/robot_sf_ll7/issues/3207/events
    gh api --paginate repos/ll7/robot_sf_ll7/issues/8173/events
  2. Read all 21 complete issue threads through scripts/dev/gh_issue_rest.py.

  3. Run classify_issue from current origin/main after removing only the false
    decision-required label from each input. All 21 currently return no decision evidence.

  4. Observe that GitHub's event record contains actor and timestamp but no source commit, task,
    worktree, plan digest, or classifier-contract version.

Scope

In scope:

  • Bind every issue-audit mutation plan and apply receipt to the producing source commit, relevant
    classifier/source digest, machine/task identity, and plan digest.
  • Before autonomous write mode, fetch origin/main and fail closed when the executing revision
    does not contain current origin/main, unless an explicit maintainer-approved diagnostic mode is
    both read-only and clearly reported.
  • Refuse apply when plan-time and apply-time source identities differ, in addition to the existing
    live issue-state compare-and-swap checks.
  • Ensure every canonical autonomous issue-audit entry point uses the same provenance guard.
  • Add a regression that models a stale producer predating the canonical-ruling fixes and proves it
    cannot write labels.

Non-goals:

Blocked by: none for implementation. A definitive historical actor attribution may remain
unavailable and is not required to close the workflow gap.

Added Value Estimation

  • User impact: prevents already-settled decisions from repeatedly consuming maintainer attention.
  • Maintenance value: makes shared-credential mutations attributable and rejects stale audit code
    before it can alter live labels.
  • Why now: the recurrence affected 21 issues after both ruling-classifier fixes had merged.

Effort / Complexity / Risk

  • Rough estimate: 3-6 hours; best estimate: 4 hours.
  • Complexity: moderate, spanning plan schema, apply validation, and autonomous entry points.
  • Main risk: an overly strict freshness check could reject a valid current feature worktree.
  • Mitigation: require write-capable workers to incorporate fetched origin/main; preserve a
    clearly read-only diagnostic mode for older revisions; test both paths.
  • Estimate confidence: 70%; the number of independent issue-audit write entry points is the main
    uncertainty.

Affected Files

  • scripts/dev/issue_audit_core.py - source/provenance fields and fail-closed apply guard.
  • Canonical goal/autonomous audit entry points discovered by rg - current-main freshness check.
  • tests/dev/test_issue_audit_core.py - stale producer, source mismatch, current source, and later
    genuine-reopen regressions.
  • docs/context/issue_audit_contract.md - mutation-provenance and freshness contract.

Definition of Done / Acceptance Criteria

  • Every write-capable audit plan and receipt records source commit, classifier/source digest,
    task or machine identity, and plan digest.
  • Apply refuses all mutations if plan-time and apply-time source identity differ.
  • Autonomous write mode refuses to run from a revision that has not incorporated freshly
    fetched origin/main; read-only diagnostics remain available and explicit.
  • A regression using pre-fix(audit): honor canonical issue rulings #7463/fix(workflow): keep ruled issues out of decision queue #8247 behavior cannot add decision-required through any
    canonical write entry point.
  • Current-main fixtures shaped like all 21 affected issues produce no decision-label addition.
  • A regression preserves the existing explicit post-ruling-request behavior.
  • Existing issue drift checks, mutation ceilings, and REST readback remain fail closed.
  • A complete live read-only replay reports no recurrence before implementation handoff.

Success Metrics

  • No live label mutation can be produced without an attributable source/version receipt.
  • A stale long-lived worker fails before its first GitHub write and emits a concrete refresh
    command.
  • The current ruling queue remains empty unless new post-ruling decision evidence exists.

Validation / Testing

  • Add red/green focused tests for stale source, source mismatch, current source, and genuine later
    reopen behavior.
  • Run the focused issue-audit test module, Ruff, format check, and git diff --check.
  • Run the repository workflow/tooling readiness path required for schema or automation changes.
  • Generate one complete read-only live audit from fresh origin/main, then inspect its plan and
    provenance receipt; no production label mutation is needed for validation.

Claim Boundary

This is workflow-integrity evidence only. It authorizes no issue ruling, blocker removal, compute,
campaign, merge, artifact admission, release, publication, benchmark conclusion, or scientific
claim.

Project Metadata

  • Priority: P1 because one stale producer can recreate the entire maintainer decision queue.
  • Effort: 4 hours best estimate.
  • Reviewed: no; triage remains required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrictionObserved workflow friction tracked rather than navigated around (fix-or-track)needs-triagepriority:1P1: unblocks multiple active delivery pathsruledAuthor ruling recorded; execution pending or completetechnical-debttype:workflowWorkflow/tooling semantics task

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions