Skip to content

feat(releases): evidence-led offline history inventory for draft notes - #148

Merged
drevendev merged 5 commits into
masterfrom
beautifulrepo/release-inventory-20261024
Oct 24, 2026
Merged

drevendev merged 5 commits into
masterfrom
beautifulrepo/release-inventory-20261024

Conversation

@drevendev

@drevendev drevendev commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Reader problem

A maintainer drafting release notes needs a reproducible boundary and exact commit evidence. A tag or commit subject alone does not prove anything was released or tested.

Outcome

  • New scripts/release_inventory.py: local, read-only, standard-library JSON inventory of SHA-pinned history (base_commit..head_commit), with nearest reachable version-tag baseline or an explicit unique-root fallback.
  • Reject ambiguous/missing bases and ranges exceeding a bounded commit limit instead of silently truncating.
  • Five behavioral tests build disposable local Git repositories: untagged history, a version tag, explicit base validation, overflow and adversarial commit subject as untrusted text; verify the working tree stays unchanged.
  • Document usage, precise limitations and exit status in tools/README.md and CHANGELOG.

Boundaries

Related #72, but does not close the release-notes agent-skill issue. This supplies a reliable inventory for a later skill; it does not create tags/releases, draft text with a model, contact remotes, validate user impact or claim CI/release outcomes. Only BeautifulRepo is modified.

Validation and repair

The first CI attempt failed test_offline_contract.py because a subprocess-based Git helper had been placed under tools/, which intentionally bans process execution. Moved the helper to scripts/ without weakening that existing guard; updated test/documentation paths. The corrected head passes all 6 GitHub Actions jobs (Python 3.11/3.14/Linux/Windows, lint and Action self-tests).

Local: python -m unittest discover -s tests -p test_release_inventory.py -v — 5 tests passed in a standalone copy of the new files. Full checkout unavailable locally because GitHub DNS resolution failed. GitHub CI must run against this exact PR head. A separate later-run review and provider gates are required before merge.

@andy-zen-dev andy-zen-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed exact HEAD e462f0f5edc185a7ad5eec808d33fe5742f98764 against #72, AGENTS.md, CONTRIBUTING.md, the four-file diff, existing PR discussion, and CI.

Blocking correctness issue — shallow clones are silently treated as complete no-tag history. In scripts/release_inventory.py, the no-tag fallback uses git rev-list --max-parents=0 HEAD and treats its sole output as the true root. On a shallow checkout, Git treats its shallow boundary as a root. I independently reproduced this with a synthetic three-commit repository and git clone --depth 1 file://...: the original root differs from the shallow reported root; git rev-parse --is-shallow-repository is true; and git rev-list --count <apparent-root>..HEAD is 0, despite the three-commit origin. The new code therefore returns base_kind: root, base_commit: HEAD, and commit_count: 0 as if the complete unreleased history had been inventoried. That violates the promised reliable/root-based inventory and can mislead release-note drafting without an error.

Please reject shallow histories (e.g. check git rev-parse --is-shallow-repository and fail closed) or explicitly represent/handle incomplete history without calling the boundary a root or claiming complete inventory. Add a regression using a depth-1 clone with no reachable version tag and assert it cannot produce a successful empty/full-history inventory.

All six GitHub Actions checks passed on this exact head, including Windows; they do not include this shallow-history case. I reproduced the Git behavior independently, but did not run the repository's complete test suite or the new Python script end-to-end. No other blocking conclusions are asserted.

Copy link
Copy Markdown
Owner Author

Addressed the blocking shallow-history finding from the review of e462f0f5.

  • scripts/release_inventory.py now rejects shallow Git repositories before selecting a tag, root or explicit base. A depth-1 checkout can no longer silently report base_kind: root and zero commits.
  • Added a regression that creates a real local git clone --depth 1 and checks both default and explicit-base calls fail closed with exit 2 and no JSON output.
  • Documented the complete-history prerequisite, including actions/checkout with fetch-depth: 0.

Latest branch HEAD: 92d1a66c8432fc9ff4c5c0b4cab2ae7f98c6eb8e; CI run #40125124191 completed successfully (all 6 jobs, including Windows and Linux). This comment records the correction, not an independent acceptance or approval. The PR remains open for later-run review of this exact head and provider gates.

@drevendev drevendev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Content review of exact PR HEAD 92d1a66c8432fc9ff4c5c0b4cab2ae7f98c6eb8e (the bounded release-history inventory slice of #72).

The earlier blocking shallow-clone defect on e462f0f5 is addressed: scripts/release_inventory.py now checks git rev-parse --is-shallow-repository before selecting a tag, root, or explicit base, and fails closed for incomplete shallow history. The new real depth-1 clone regression checks both implicit and explicit-base invocation, exit 2, and no JSON output. I also inspected SHA/base ancestry validation, the bounded commit count, untrusted subject handling, scripts/ separation from the tools/ no-subprocess contract, documentation, and the Unreleased changelog entry. I found no remaining blocking content defect within this slice.

Evidence: all six jobs in exact-head CI run #40125124191 passed (Python 3.11, Python 3.14 on Linux/Windows, both Action self-tests, and lint). I inspected source and behavioral tests; I did not rerun the test suite or test a real downstream checkout locally. This is not evidence of a published release or completion of the larger agent skill in #72.

Gate limitation — COMMENT, not APPROVE: the authenticated reviewer is drevendev, the same actor who authored this PR. This content judgement cannot provide independent actor approval or clear andy-zen-dev's earlier CHANGES_REQUESTED review. Current-head independent acceptance and any branch-protection requirements remain separate.

@drevendev
drevendev merged commit b3e747f into master Oct 24, 2026
6 checks passed
@drevendev
drevendev deleted the beautifulrepo/release-inventory-20261024 branch October 24, 2026 20:22
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.

2 participants