chore: include Refs: #<PR> in agent-dev's ledger header #25

Merged
erik merged 1 commit from chore/dev-ledger-refs-pr into main 2026-05-25 22:08:10 +00:00
Member

Refs: #22


Summary

  • When writing the dev ledger via fjx dev ledger, look up the linked PR and append Refs: #<N> to the fjx-managed header. Resolution uses config.issue.pr_branch from cache first, falling back to findLinkedPr against open PRs.
  • Header generation factored into renderFjxManagedHeader(role, status, checkpoint, prNumber?); renderInitialLedger now composes from it. Only role === "dev" emits Refs: (and only when a PR exists), matching the issue scope.
  • No change to other roles (pm, qa) or to the initial-bootstrap ledger (no PR at fjx dev next time).

Test plan

  • just validate — green (103 tests pass; format, lint, types, gen-drift, coverage, audit, secrets, sast).
  • New unit tests in src/ledger.test.ts:
    • dev + PR ⇒ header contains Refs: #<N>
    • dev without PR ⇒ no Refs: line
    • non-dev role with prNumber ⇒ no Refs: line (role-scoped)
    • renderInitialLedger("dev", …) ⇒ no Refs: (matches bootstrap reality)
Refs: #22 --- ## Summary - When writing the dev ledger via `fjx dev ledger`, look up the linked PR and append `Refs: #<N>` to the fjx-managed header. Resolution uses `config.issue.pr_branch` from cache first, falling back to `findLinkedPr` against open PRs. - Header generation factored into `renderFjxManagedHeader(role, status, checkpoint, prNumber?)`; `renderInitialLedger` now composes from it. Only `role === "dev"` emits `Refs:` (and only when a PR exists), matching the issue scope. - No change to other roles (`pm`, `qa`) or to the initial-bootstrap ledger (no PR at `fjx dev next` time). ## Test plan - [x] `just validate` — green (103 tests pass; format, lint, types, gen-drift, coverage, audit, secrets, sast). - [x] New unit tests in `src/ledger.test.ts`: - dev + PR ⇒ header contains `Refs: #<N>` - dev without PR ⇒ no `Refs:` line - non-dev role with `prNumber` ⇒ no `Refs:` line (role-scoped) - `renderInitialLedger("dev", …)` ⇒ no `Refs:` (matches bootstrap reality)
chore(ledger): include Refs: #<PR> in agent-dev's fjx-managed header
All checks were successful
Validate / validate (pull_request) Successful in 23s
b154d0adcb
When writing the dev ledger via `fjx dev ledger`, look up the linked PR (cache or findLinkedPr) and append `Refs: #<N>` to the fjx-managed header so tooling and humans can resolve the PR without re-scanning. Other roles are unchanged.

Refs: #22
erik merged commit 50500689d1 into main 2026-05-25 22:08:10 +00:00
erik deleted branch chore/dev-ledger-refs-pr 2026-05-25 22:08:10 +00:00
Sign in to join this conversation.
No description provided.