feat(ledger): add a reopen action and fold the #WFYDV6 split back into one identity

Merged
BI
1mo ago
+244-9

User description

Summary

  • Adds a reopen request kind to scripts/ledger-inbox.mjs. It is validated (canonical ID, pri P1–P3, required detail and source, optional targetUlid), fingerprint-checked against the archived row, and can be created from the CLI (ledger-inbox.mjs reopen --id #XXXXXX --pri P1 --detail … --source …).
  • Adds reopenIssue in scripts/outstanding-issues.mjs. It moves a durable archived row back to the open-items table with its original display ID and ULID, so a reopened issue keeps one identity instead of being re-added as a new row.
  • Fixes ledger task 177b7474 (#GYR7Q3) and the #WFYDV6 split. In #WFYDV6's case, re-adding the issue (request a5c25ca4, which becomes #Z12CBC) gave it two ledger identities.
  • Ports only the script part of the reverted Qodo commit dc4265446. Its in-place rewrite of request a5c25ca4 is not carried over, because existing requests are immutable. The formatting, usage text and tests come from the follow-up patch.
  • The #WFYDV6 fold-back requests (reopen #WFYDV6, close #Z12CBC as folded into it, close #GYR7Q3) are queued through ledger-inbox in a follow-up commit on this branch, after the reconcile in #3625 lands, so their fingerprints match the reconciled ledger.

Areas touched: Knowledge and records

Verification

  • Checks run: vitest run tests/ledger-inbox.test.ts tests/outstanding-issues*.test.ts tests/ledger-inbox-*.test.ts: 181 passed, including the new reopen requests suite (original ID and ULID kept, archive row removed, second reopen and stale fingerprint rejected, legacy rows and incomplete requests refused). All Static PR checks steps pass locally, including check:knip and check:outstanding-issues, and eslint is clean on the changed files.

Risk and rollout

  • Risk: low. This is ledger tooling only. Existing request kinds are unchanged; reopen is additive and fingerprint-guarded.
  • Rollback: revert the commit.
  • Provider or production effects: None

Notes

  • Does not sign anything off. #WFYDV6 stays open as P1 per the 17 Oct 2026 owner decision. The Form 6A/6B wording still needs owner, legal and clinical sign-off.

Summary by cubic

Adds a reopen request kind to the ledger inbox so an archived issue can be moved back to the open-items table with its original display ID and ULID, restoring a single ledger identity. This folds the #WFYDV6 split back into one row and fixes #GYR7Q3.

Notes

  • reopen requires pri (P1–P3), detail, source, and a valid archive fingerprint; the CLI generates the request from --id, --pri, --detail, --source, and optional --targetUlid.
  • reopenIssue refuses rows that are still open or lack a durable ULID, and rejects a second reopen or a stale fingerprint; requests whose targetUlid names a different issue than the id are refused instead of silently rewriting the target.
  • The reopened row keeps the prior resolution discoverable in its detail as (Previously archived <date>: <outcome>), and a ULID-derived display prefix still matches a collision-extended id.
  • Rollback is a revert; this is ledger tooling only and carries over no in-place rewrite of existing requests.

CodeAnt-AI Description

Reopen archived issues without creating a second identity

What Changed

  • Reopen an archived durable issue into the open list with its original ID, type, summary, and ULID.
  • Supply a priority, detail, and source for the reopened issue; the archived row is removed.
  • Reopening requires the archive entry to be unchanged, and a second reopen is rejected.

Impact

✅ Reopened issues keep their original identity
✅ No duplicate entries when returning issues to triage
✅ Stale reopen requests are rejected

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features
    • Inbox requests can reopen archived issues, returning them to the Open items list while preserving their display ID and identifier.
    • Reopen requests require a valid issue ID, priority (P1, P2, or P3), details, and source. Requests must also reference a current archived issue; invalid, incomplete, or repeated requests are rejected.