Skip to content

Dead-lettered purpose job stalls its discovery ledger row #772

In review

Description

@harlan-github-agent

reconcileLedger matches only dead-lettered registry/repository-submission jobs, so a submission whose registry/repository-purpose job dead-letters (ghost-brief/skills, AiGateway 7005 billing error, 2026-12-02T21:31Z) leaves its ledger row 'submitted' forever and alarms as stalled every night.

Target: shared/server/discovery-ledger.ts (reconcileLedger)

Verify with: pnpm exec cf d1 query a5e53f35-f5e5-4987-8c67-c0175addc7cc --remote --sql "SELECT COUNT(*) AS n FROM discovery_ledger WHERE status='submitted' AND submitted_at < (strftime('%s','now') - 21600)" returns 0 after the fix deploys and reconcile runs.

Estimated to change 2 files.

The daily-checkin routine opened this issue automatically on its 2026-12-01T20:40:00.000Z run. It is not Harlan's own report. Close it to reject the proposal, and the reason you give stops it being offered again.

Activity

  1. added
    harlan-agent-running
    on Dec 3, 2026
  2. harlan-github-agent commented on Dec 3, 2026

    @harlan-github-agent
    ContributorAuthor

    🟢 Ready to implement · difficulty 2/5 · impact 3/5

    Confirmed: reconcileLedger's dead-letter branches match only no_supported_skill_paths, root_skill_unsupported and repository_purpose_review_required, so a purpose-classification failure (AiGateway 7005) dead-lettering the submission job mat

    Plan for the implementing agent

    In a task worktree, capture the exact dead-letter exception text for ghost-brief/skills from failed_jobs (job_type registry/repository-submission, the 2026-12-02T21:31Z AiGateway 7005 run) so the SQL LIKE pattern matches real production text, not a guess. Write a failing test in test/unit/discovery-ledger-reconcile.test.ts first: a purpose-classification dead-letter must not leave the row stalled. Extend shared/server/discovery-ledger.ts reconcileLedger with a branch recognizing that dead-letter, following the PR #605 precedent (park with held_reason like repository_purpose_review_required, submitted_at cleared) or returning the row to pending for retry if the error is judged transient infra; state the choice in the PR. Note the existing test 'leaves a submission whose dead-letter names something else alone' encodes that unmatched dead-letters stall by design, so adjust expectations only for the purpose-classification case. Run pnpm test:run for the discovery-ledger suites before opening the PR.

    Reproduction: yes. Codebase review: not needed.

    Harlan Agent Kit automated triage, not Harlan's commitment · AI policy

  3. added
    harlan-agent-ready-to-implement
    harlan-agent-running
    and removed
    harlan-agent-running
    on Dec 3, 2026
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

    harlan-agent-ready-to-implementroutine:daily-checkin

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions