Skip to content

feat(pipeline): emit CLI release ledger skeletons#2859

Merged
mergify[bot] merged 1 commit into
mainfrom
feat/generated-release-ledger
Jun 8, 2026
Merged

feat(pipeline): emit CLI release ledger skeletons#2859
mergify[bot] merged 1 commit into
mainfrom
feat/generated-release-ledger

Conversation

@tmchow

@tmchow tmchow commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • emit blank .printing-press-release.json and CHANGELOG.md skeletons beside .printing-press.json for newly generated CLIs
  • preserve existing release ledger files when manifests are rewritten, so reprints do not wipe public-library changelog history
  • update generated AGENTS.md guidance and printing/publish skills so agents know the public library owns final YYYY.M.N release stamping after merge

Validation

  • go test ./internal/pipeline
  • scripts/verify-generator-output.sh
  • go test ./...
  • scripts/golden.sh verify
  • git diff --check

@mergify

mergify Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 require-ready-label-and-ci

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0
  • check-success = build-and-test
  • check-success = generated-test
  • check-success = go-lint
  • check-success = golden
  • check-success = pr-title
  • check-success = test
  • any of:
    • label = ready-to-merge
    • all of:
      • head = release-please--branches--main
      • title ~= ^chore\(main\): release
  • any of:
    • -files ~= ^(\.github/workflows/|\.github/scripts/|scripts/|\.github/CODEOWNERS$)
    • author = tmchow
    • approved-reviews-by = mvanhorn
    • approved-reviews-by = tmchow
    • author = mvanhorn
  • any of:
    • check-success = Greptile Review
    • label = queued
    • check-neutral = Greptile Review
    • check-skipped = Greptile Review
    • head ~= ^mergify/merge-queue/
    • all of:
      • head = release-please--branches--main
      • title ~= ^chore\(main\): release

@tmchow tmchow changed the title Emit per-CLI release ledger skeletons feat(pipeline): emit CLI release ledger skeletons Jun 8, 2026
@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds release-ledger skeleton emission to the generator pipeline: WriteCLIManifest now also writes blank .printing-press-release.json and CHANGELOG.md siblings on first print, and preserves them on reprint. The publish skill's copy step is replaced with a staging + atomic mv pattern that saves existing ledger files to a temp directory before overwriting, then restores them.

  • internal/pipeline/climanifest.go: New CLIReleaseManifest struct + WriteReleaseLedgerSkeleton helper that writes the blank manifest/changelog only when absent; WriteCLIManifest and (indirectly, via the same call path) RefreshCLIManifestFromSpec both pick this up.
  • skills/printing-press-publish/SKILL.md: Old rm -rf … && cp -r … replaced with mktemp swap-dir + ledger preservation loop + atomic mv; a trap … EXIT cleans up both temp dirs on failure.
  • Templates, golden fixtures, AGENTS.md, skills docs: Consistent "Release Ledger" guidance added across all generated and reference files.

Confidence Score: 5/5

Safe to merge — the generator and publish skill changes are well-scoped, tests cover both the fresh-print and reprint paths, and all golden fixtures are updated consistently.

The skeleton-writing logic in WriteReleaseLedgerSkeleton uses an existence check before writing, so reprints leave existing changelog history untouched. The publish skill's swap-dir + atomic mv correctly stages the full CLI (with preserved ledger files) before touching the live publish-repo directory. The contracts tests lock down the new shell patterns. No credential-path reads were introduced.

No files require special attention.

Important Files Changed

Filename Overview
internal/pipeline/climanifest.go Adds CLIReleaseManifest struct and WriteReleaseLedgerSkeleton; skeleton files are written only when absent (preserving reprints); wired into WriteCLIManifest and RefreshCLIManifestFromSpec via the same call chain.
internal/pipeline/climanifest_test.go Adds tests for skeleton creation (verifies blank version/released_at/source_commit, absent changes key, correct slug), preservation of existing ledger files on reprint, and existence checks in WriteManifestForGenerate; coverage is thorough.
skills/printing-press-publish/SKILL.md CLI copy step replaced with mktemp swap-dir + ledger preservation loop + atomic mv; trap guards both temp dirs on failure; previous-thread concern about missing trap is addressed.
internal/pipeline/contracts_test.go Contract tests updated to assert the new cp-R/swap-dir/mv/trap strings in the publish skill; correctly replaces the old cp-r string anchors.
skills/printing-press/SKILL.md Adds CLI_RELEASE_VERSION read from .printing-press-release.json during pre-research state snapshot; display instruction correctly notes it is CalVer, not generator version.
internal/generator/templates/agents.md.tmpl Added Release Ledger section identical to agents_device.md.tmpl; guidance text matches AGENTS.md and golden fixtures.
internal/generator/templates/agents_device.md.tmpl Added Release Ledger section; mirrors agents.md.tmpl change; golden device AGENTS.md files are updated consistently.

Sequence Diagram

sequenceDiagram
    participant G as Generator
    participant FS as Filesystem
    participant P as Publish Skill
    participant LIB as printing-press-library

    G->>FS: write .printing-press.json
    G->>FS: stat .printing-press-release.json
    alt fresh print (file absent)
        G->>FS: write skeleton .printing-press-release.json
        G->>FS: write skeleton CHANGELOG.md
    else reprint (file present)
        G-->>FS: skip, preserve existing ledger files
    end

    P->>FS: find existing ledger files in publish repo
    P->>FS: save to RELEASE_LEDGER_TMP
    P->>FS: cp -R staged CLI to PUBLISH_SWAP_DIR
    P->>FS: restore ledger files into PUBLISH_SWAP_DIR
    P->>FS: rm -rf old slug dir
    P->>FS: mv PUBLISH_SWAP_DIR to DEST_CLI_DIR (atomic)
    P->>FS: rm -rf RELEASE_LEDGER_TMP and clear trap
    LIB->>FS: post-merge workflow stamps version and released_at
Loading

Reviews (2): Last reviewed commit: "feat(pipeline): emit CLI release ledger ..." | Re-trigger Greptile

Comment thread skills/printing-press-publish/SKILL.md
Comment thread internal/pipeline/climanifest.go
@tmchow tmchow force-pushed the feat/generated-release-ledger branch from 375e8c1 to 6962137 Compare June 8, 2026 05:22
@tmchow tmchow force-pushed the feat/generated-release-ledger branch from 6962137 to 0a3a0a1 Compare June 8, 2026 05:26
@tmchow tmchow added the ready-to-merge Allow Mergify to queue and merge this PR when protections pass label Jun 8, 2026
mergify Bot added a commit that referenced this pull request Jun 8, 2026
@mergify mergify Bot added the queued PR is in the Mergify merge queue label Jun 8, 2026
@mergify mergify Bot merged commit e13b00d into main Jun 8, 2026
31 checks passed
@mergify mergify Bot deleted the feat/generated-release-ledger branch June 8, 2026 05:48
@mergify

mergify Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 10 minutes 22 seconds in the queue, including 10 minutes 8 seconds running CI.

Required conditions to merge

@mergify mergify Bot removed the queued PR is in the Mergify merge queue label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Allow Mergify to queue and merge this PR when protections pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant