Skip to content

Fix release regex parsing and missing artifact prepare coverage - #254

Merged
unbraind merged 1 commit into
mainfrom
fix/toolchain-gate-drift
Oct 17, 2026
Merged

unbraind merged 1 commit into
mainfrom
fix/toolchain-gate-drift

Conversation

@unbraind

@unbraind unbraind commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Dependabot #248 updates the canonical workflow auditor, which mistakes the inline Bash release-version regex tail for an executable: cannot prove executable expansion; refusing an unresolved publish path: ?$ ]]. This is a shell-model compatibility defect rather than a pinned-version assertion.

Keep the identical regex in a single-quoted literal variable, then execute the actual Bash condition against ordinary, suffixed, padded and malformed version strings. The canonical auditor still checks every publish for provenance.

Full CI-identity validation exposed a second defect shared with unbraind/pm-ado#30 and unbraind/pm-beads#144: the updated prepare launcher adds pack/publish branches absent from the install-only tests. Apply the same explicit lifecycle helper and configured Git-checkout artifact tests in all three repos. Dependency pins, canonical template equality and coverage thresholds remain unchanged.

Before: the repository-workflow gate rejects the inline regex. Fixing that alone leaves 613 passing functional tests but 99.98% lines / 99.95% branches, missing prepare line 28. After both fixes: each full runtime gate passes 615/615 with zero failures, skips, cancellations or todos and 100% lines, branches and functions.

Revert proofs: restore only the original release workflow condition and the repository-workflow test fails with the original unresolved-path diagnostic. Keep the new artifact tests but remove only lifecycle-command injection from the prepare helper and launcher coverage fails at 98.65% lines / 75% branches, missing line 28. Restoring both fixes passes the complete gates.

Validation: full exact dependency-overlay npm and Bun gates, using a fresh HOME and GIT_CONFIG_GLOBAL=/dev/null plus GIT_CONFIG_NOSYSTEM=1. Commands: npm run release:check and bun run release:check. Current-pin focused PM-linked suites also pass 25/25 workflow/auditor tests and 10/10 prepare tests. Local interrupted full runs are not counted as pass evidence. Details: docs/dependabot-root-cause.md.

Tracker: pmc-38z4, left open for orchestration review.

The final validation tree differs from the delivered fix revision only by the original dependency/generated-template overlay and its temporary validation workflow. Tracker receipts and documentation are included in this final validation.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 733fe6b9-57fb-4423-b0f0-ed613af7ffe6
📥 Commits

Reviewing files that changed from the base of the PR and between 4711012 and 38fd0ac.

📒 Files selected for processing: 6
  • .agents/pm/chores/pmc-38z4.toon
  • .agents/pm/history/pmc-38z4.jsonl
  • .github/workflows/release.yml
  • docs/dependabot-root-cause.md
  • test/prepare-merge-driver.test.ts
  • test/release-workflow.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Summary by CodeRabbit

  • Bug Fixes

    • Improved release-version validation to correctly handle valid version formats and reject malformed values.
    • Improved validation of package preparation during pack and publish workflows, helping ensure Git settings remain unchanged.
  • Documentation

    • Added an investigation record documenting the Dependabot update failure, validation results, and release-check outcomes.

Walkthrough

The release workflow now matches its date-version pattern through a variable, with Bash regression tests for valid and invalid versions. Prepare-merge-driver tests cover pack and publish. The PR adds investigation and npm/Bun validation records for the Dependabot update.

Changes

Dependabot release validation

Layer / File(s) Summary
Release version check and regression coverage
.github/workflows/release.yml, test/release-workflow.test.ts, docs/dependabot-root-cause.md, .agents/pm/chores/pmc-38z4.toon, .agents/pm/history/pmc-38z4.jsonl
The workflow matches the unchanged date-version pattern through version_pattern. Bash tests check version captures and reject malformed inputs. The root-cause document and PM records describe the failure, regression checks, and tracked validation.
Lifecycle-command coverage and certification records
test/prepare-merge-driver.test.ts, docs/dependabot-root-cause.md, .agents/pm/chores/pmc-38z4.toon, .agents/pm/history/pmc-38z4.jsonl
The prepare test helper accepts a lifecycle command, defaulting to ci. New tests cover pack and publish and verify Git configuration and merge-driver registrations remain unchanged. The records document revert evidence and npm/Bun validation results.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related PRs

  • unbraind/pm-changelog#159: It changes the release workflow and adds release-workflow tests, which cover the same validation path.
Merge Risk: ⚪ Minimal · up to 38fd0

No confirmed issue blocks merging. The pack and publish test-coverage question remains unverified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly summarizes both primary changes: release regex parsing and missing prepare coverage.
Description check Passed The description directly explains the release regex auditor defect, prepare coverage gap, implemented fixes, and validation results.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (4 skipped: 4 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (4 skipped: 4 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Sorry @unbraind, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 2 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR fixes canonical release-workflow auditing by binding the Bash version regex as literal data, adds regression coverage for its matching semantics, and restores prepare-launcher coverage for npm pack/publish while validating that configured checkout artifacts remain intact.

Sequence diagram for release workflow version parsing and publish audit

sequenceDiagram
    participant Workflow as ReleaseWorkflow
    participant Bash as Bash
    participant Auditor as CanonicalAuditor
    participant Registry as PackageRegistry
    Workflow->>Bash: npm pkg get version
    Workflow->>Bash: version_pattern='^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-[0-9]+)?$'
    Bash-->>Workflow: current_version
    Workflow->>Bash: [[ "$current_version" =~ $version_pattern ]]
    Bash-->>Workflow: BASH_REMATCH or no match
    Workflow->>Auditor: validate publish provenance
    Auditor->>Registry: verify publish path
    Registry-->>Auditor: provenance result
    Auditor-->>Workflow: release gate result
Loading

Sequence diagram for prepare artifact lifecycle coverage

sequenceDiagram
    participant Test as PrepareTests
    participant Helper as LifecycleHelper
    participant Launcher as PrepareLauncher
    participant Checkout as ConfiguredCheckout
    participant Package as PackageManager
    Test->>Helper: run lifecycle command
    Helper->>Launcher: invoke prepare
    Launcher->>Checkout: read configured checkout
    Checkout-->>Launcher: checkout configuration
    Launcher->>Package: npm pack
    Package-->>Launcher: packed artifact
    Launcher->>Package: npm publish
    Package-->>Launcher: published artifact
    Launcher-->>Helper: prepare result
    Helper-->>Test: artifact and lifecycle assertions
Loading

File-Level Changes

Change Details Files
Make the release-version regex consumable by the canonical workflow auditor while preserving Bash matching behavior.
  • Move the regex into a single-quoted shell variable and reference it from the condition.
  • Add Bash-backed regression cases for valid, suffixed, padded, and malformed versions.
  • Document the auditor incompatibility, validation setup, and revert proofs.
.github/workflows/release.yml
test/release-workflow.test.ts
docs/dependabot-root-cause.md
Restore prepare lifecycle coverage for artifact-producing npm commands and verify configured checkout state is preserved.
  • Allow the test launcher helper to inject an explicit npm lifecycle command.
  • Exercise pack and publish against a configured checkout and verify Git merge-driver configuration remains unchanged.
  • Retain coverage and provenance assertions without changing dependency pins or thresholds.
test/prepare-merge-driver.test.ts
Update project tracking records for the completed fix and validation.
  • Record chore status and implementation details in the PM task and history files.
.agents/pm/chores/pmc-38z4.toon
.agents/pm/history/pmc-38z4.jsonl

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Please review head 38fd0ac, including outside-diff findings.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@unbraind
unbraind merged commit b9c91c5 into main Oct 17, 2026
11 checks passed
@unbraind
unbraind deleted the fix/toolchain-gate-drift branch October 17, 2026 10:29
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.

1 participant