Skip to content

fix(discovery): park purpose-held submissions in the ledger - #605

Merged
harlan-zw merged 1 commit into
mainfrom
fix/issue-603
Oct 10, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/issue-603

Conversation

@harlan-github-agent

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #603

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The purpose gate added in #581 fails new submissions it cannot classify with repository_purpose_review_required. When that job exhausts its retries, reconcileLedger had no branch for the dead-letter, so five ledger rows (antfu/skills-pack, feitangyuan/onetake, trungtin/codex-delegate, tsogjavklann/awwwards-3d, aryanutkarsh/seecode) stayed submitted and alarmed as stalled every night instead of parking for the review surface.

The gate is a request for a person, not an answer about the repository. Emptying the row would record a verdict nobody made, and retrying re-runs a job that fails the same gate. So the row parks: back to pending with held_reason = 'repository_purpose_review_required' and submitted_at cleared, which puts it on the holds surface, out of the submit queue, and out of the stalled count.

One thing a reviewer should weigh: releasing a hold on the discovery surface alone re-enqueues the submission, and the gate fails it again unless a trust override or owner verification exists; rejecting records the human no. I did not teach the purpose admission check to read reviewed_at, since that widens the change past the ledger.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 9, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-10 06:13 UTC.

GitHub merged this pull request.

  • Logged (38/100): Releasing a purpose hold is silently reverted by the next reconcile matching the historical dead-letter, and a successfully re-indexed repo can stay stranded on the holds surface and never announce. View code Optional follow-up: Add a freshness guard (e.g. f.failed_at > discovery_ledger.submitted_at, or match only the dead-letter belonging to the latest submission) so only a dead-letter from the current submission parks the row.
    • Ask an agent to verify and fix this finding
  • Logged (22/100): A repository deleted after discovery but before its job runs dead-letters as 'repo fetch 404' and its ledger row stalls forever, reproducing the permanent nightly alarm this PR fixes only for the purpose-classification reason. View code Optional follow-up: Park such rows as terminal gone (mirroring migration 0107's semantics) or clear submitted_at when a repo-fetch-4xx dead-letter matches, so the stalled count only reports genuinely unfinished submissions.
    • Ask an agent to verify and fix this finding

a244c334-2118-416b-9265-9ae16cf3cf7d

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 9, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit bf9e5f7 into main Oct 10, 2026
8 checks passed
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Oct 10, 2026
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.

Purpose-held submissions stall the discovery ledger forever

1 participant