Skip to content

fix(keepalive): skip reporter replay without authority ledger - #3672

Closed
stranske wants to merge 1 commit into
mainfrom
codex/keepalive-replay-missing-ledger-20261001
Closed

stranske wants to merge 1 commit into
mainfrom
codex/keepalive-replay-missing-ledger-20261001

Conversation

@stranske

@stranske stranske commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Treat a confirmed absent authority ledger as an empty reporter replay for ordinary PRs.
  • Preserve fail-closed behavior for all other ledger read failures.
  • Sync the consumer template and update manifest and keepalive contract docs.

Validation

  • node --test .github/scripts/tests/keepalive-reporter-applicability.test.js (25 passed)
  • scripts/sync_templates.sh
  • scripts/validate_template_completeness.py
  • git diff --check

Addresses the exact-head finding on stranske/Portable-Alpha-Extension-Model#2318. Regenerate through Maint 68/71 after source merge; do not patch generated PRs.

Summary by CodeRabbit

  • Bug Fixes
    • Reporter replay now completes without further processing when no authority ledger exists, rather than treating the missing ledger as an error.
    • Errors reading an existing ledger continue to be reported, and other uncertain replay conditions remain retryable.
  • Documentation
    • Updated the keepalive guidance to clarify how missing ledgers and other uncertain conditions are handled.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 16:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T16:49:27.988451Z 35a6a18 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@stranske
stranske deployed to agent-standard October 1, 2026 16:47 — with GitHub Actions Active
@agents-workflows-bot

Copy link
Copy Markdown
Contributor

Workflow source needed

PR #3672 needs either a linked GitHub issue or one valid non-issue Workflow Source before PR metadata automation can manage it safely.

Please do one of:

  • Add <!-- meta:issue:123 --> or a normal Closes #123 / Related to #123 line.
  • Check one Workflow Source option in the PR body.
  • Add a hidden marker such as <!-- workflow-source:local_request -->, <!-- workflow-source:manual_remote -->, <!-- workflow-source:review_followup -->, <!-- workflow-source:sync_campaign -->, or <!-- workflow-source:dependabot -->.
  • Add a workflow source label such as workflow:source-direct-pr, workflow:source-local-request, workflow:source-review-followup, workflow:source-sync, or workflow:no-automation.

Once a valid source is present, this warning will not be reposted.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: stranske/Workflows/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 536d4de2-67ae-4c9f-b945-0ebc66be0e32

📥 Commits

Reviewing files that changed from the base of the PR and between 59801ee and 35a6a18.

📒 Files selected for processing (5)
  • .github/scripts/__tests__/keepalive-reporter-applicability.test.js
  • .github/scripts/keepalive_reporter_applicability.js
  • .github/sync-manifest.yml
  • docs/keepalive/GoalsAndPlumbing.md
  • templates/consumer-repo/.github/scripts/keepalive_reporter_applicability.js

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

Reporter replay now returns an empty result when the authority ledger is confirmed missing. Other ledger-read errors remain fatal. The change also updates the consumer-repository template, tests, manifest description, and documentation.

Changes

Reporter replay

Layer / File(s) Summary
Missing-ledger replay handling
.github/scripts/keepalive_reporter_applicability.js, templates/consumer-repo/.github/scripts/keepalive_reporter_applicability.js, .github/scripts/__tests__/keepalive-reporter-applicability.test.js, docs/keepalive/GoalsAndPlumbing.md, .github/sync-manifest.yml
Replay allows a missing authority ledger and stops when the read returns null. Tests verify an empty result without a run lookup and confirm that other read errors are propagated. The template, manifest description, and documentation reflect this behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 35a6a

A confirmed missing ledger now produces an empty reporter replay, and other ledger-read errors remain distinct. No material merge risk is established by the workflow or operator contract.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: skipping reporter replay when the authority ledger is absent.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35a6a181ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +171 to +174
const authority = await readAuthority(request, repository, number, { allowMissing: true });
// Most keepalive PRs never enter the challenge path and have no ledger.
// Only a confirmed 404 is an empty replay; all other read failures remain fatal.
if (authority === null) break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Distinguish an absent ledger from an inaccessible authority ref

When the authority branch is missing, deleted, or concealed by repository access, the Contents API returns the same 404 as a missing PR ledger, and readAuthorityState(..., { allowMissing: true }) maps every such response to null. This function also never verifies that the PR is actually an ordinary, non-authority PR, so the unconditional break can report a successful replay while silently abandoning an existing challenge receipt; verify the authority ref and the PR's ordinary state before treating the file-level 404 as an empty replay.

Useful? React with 👍 / 👎.

@agents-workflows-bot

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: b9925f6
Latest Runs: ⏳ pending — Gate
Required contexts: summary
Required: core tests (3.12): ⏳ pending, core tests (3.13): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending —

Coverage Overview

  • Coverage history entries: 0

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

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 review overview

🟢 Approval recommended

The focused change preserves fail-closed error handling and includes aligned tests, documentation, and consumer templates.

Review effort: Balanced
Findings: None

What changed in this PR

Makes reporter replay safely skip ordinary PRs without an authority ledger, resolving the consumer sync finding.

Changes:

  • Treat missing ledgers as empty replays while preserving other failures.
  • Add success and failure-path tests.
  • Synchronize templates, manifest metadata, and keepalive documentation.
File Description
.github/​scripts/​keepalive_reporter_applicability.js Enables no-ledger replay handling.
templates/​consumer-repo/​.github/​scripts/​keepalive_reporter_applicability.js Mirrors the source implementation.
.github/​scripts/​__tests__/​keepalive-reporter-applicability.test.js Tests missing-ledger and failure behavior.
.github/​sync-manifest.yml Updates the managed script description.
docs/​keepalive/​GoalsAndPlumbing.md Documents replay semantics.

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

@stranske

stranske commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #3674 on the registry-compliant branch codex/issue-3654-keepalive-replay-safety at exact head 319ad9d3de8358ef14e700c100b990e4fca8dffe. The replacement links source issue #3654, preserves the no-ledger replay fix, and resolves the active review finding by proving absence from a complete pinned authority tree; missing refs, malformed or truncated trees, and unreadable present blobs now fail closed. It also defers exact active attempts without reconciliation writes. Focused validation: 68 Node tests, 3 authority-delivery tests, template completeness, and sync-manifest compilation all pass.

@stranske stranske closed this Oct 1, 2026
@stranske
stranske deleted the codex/keepalive-replay-missing-ledger-20261001 branch October 3, 2026 17:43

This branch was successfully deployed

1 active deployment
agent-standard — 35a6a181 Deployed Oct 1, 2026 by stranske via privilege environment gate #14467
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