code-foundry 0.38.0 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -473,7 +473,7 @@ runs:
473
473
  steps.profile.outputs.javascript_package_manager == 'bun'
474
474
  uses: oven-sh/setup-bun@v2
475
475
  with:
476
- bun-version: 1.3.14
476
+ bun-version: 1.4.0
477
477
 
478
478
  - name: Enable Corepack
479
479
  if: >-
package/.mise.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tools]
2
2
  node = "24.18.0"
3
- bun = "1.3.14"
3
+ bun = "1.4.0"
4
4
 
5
5
  [settings]
6
6
  experimental = true
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.38.1](https://github.com/0xPlayerOne/code-foundry/compare/v0.38.0...v0.38.1) (2026-08-29)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **release:** avoid unsafe history-only reconciliation PRs ([#412](https://github.com/0xPlayerOne/code-foundry/issues/412)) ([941f08b](https://github.com/0xPlayerOne/code-foundry/commit/941f08ba7e830ec3ab0ae9c6b937e488c621b95e))
9
+
3
10
  ## [0.38.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.37.5...v0.38.0) (2026-08-24)
4
11
 
5
12
 
package/docs/WORKFLOWS.md CHANGED
@@ -136,7 +136,9 @@ so repositories without a Deploy Key ruleset bypass still reconcile successfully
136
136
 
137
137
  When the protected `staging` branch rejects the exact-lease reconcile push with
138
138
  a branch-policy/ruleset/required-PR error, the reconcile job does not fail:
139
- it opens (or reuses) a generated `code-foundry/reconcile/main-to-staging`
139
+ if the branch trees are already identical, it reports a content-aligned no-op
140
+ because a normal pull request cannot safely represent a history-only ref move.
141
+ Otherwise, it opens (or reuses) a generated `code-foundry/reconcile/main-to-staging`
140
142
  pull request whose head contains the exact target tip (the `main` tip for a
141
143
  fast-forward, the replay tip when staging-only commits are replayed) and whose
142
144
  body documents the reconciliation. Reruns reuse the open pull request instead
@@ -146,6 +148,11 @@ history, replay conflicts, authentication errors, and ambiguous or stale pull
146
148
  request state still fail the job closed, and exact-lease protection stays in
147
149
  place for every direct push.
148
150
 
151
+ Repositories using the generated pull request fallback must enable
152
+ **Settings > Actions > General > Workflow permissions > Allow GitHub Actions
153
+ to create and approve pull requests**. Code Foundry reports this exact setting
154
+ when GitHub rejects pull request creation through the Actions integration.
155
+
149
156
  For this reconciliation path, maintainer PATs and administrator roles are not
150
157
  authorized bypasses; the job deliberately authenticates with `github.token`,
151
158
  not `CODE_FOUNDRY_TOKEN` or `RELEASE_PLEASE_TOKEN`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.38.0",
3
+ "version": "0.38.1",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",
@@ -12,7 +12,7 @@
12
12
  "bugs": {
13
13
  "url": "https://github.com/0xPlayerOne/code-foundry/issues"
14
14
  },
15
- "packageManager": "bun@1.3.14",
15
+ "packageManager": "bun@1.4.0",
16
16
  "bin": {
17
17
  "code-foundry": "src/cli.mjs"
18
18
  },
@@ -197,6 +197,14 @@ function executeReconciliationMutation(target, base, head, state) {
197
197
  }
198
198
  }
199
199
  if (classification.category === 'policy') {
200
+ // A normal pull request cannot faithfully represent a history-only ref
201
+ // alignment. GitHub compares the divergent ancestry and can render a
202
+ // large, misleading content diff even though both branch trees are
203
+ // already identical. Preserve the protected branch and report the
204
+ // content-aligned state instead of opening an unsafe synchronization PR.
205
+ if (state.plan.action === 'aligned') {
206
+ return { success: true, result: { synchronization: 'content-aligned' } }
207
+ }
200
208
  return deliverReconciliationPullRequest(target, base, head, state, targetSha, {}, classification.message)
201
209
  }
202
210
  return { success: false, retry: true, error: `${head} synchronization failed with lease: ${classification.message}` }
@@ -282,7 +290,7 @@ function deliverReconciliationPullRequest(target, base, head, state, targetSha,
282
290
  selection = selectReconciliationPullRequest(prs, expected)
283
291
  if (selection.error) return failResult(selection.error)
284
292
  if (selection.create) {
285
- return failResult(`gh pr create failed for ${branch}: ${sanitizeReconcileOutput(created.stderr) || 'unknown error'}`)
293
+ return failResult(reconciliationPullRequestCreateError(branch, created.stderr))
286
294
  }
287
295
  if (!selection.reuse) return failResult(`No reusable reconciliation pull request for ${branch} after gh pr create failed.`)
288
296
  return reuseReconciliationPullRequest(target, repository, selection.reuse, targetSha, body)
@@ -300,6 +308,15 @@ function deliverReconciliationPullRequest(target, base, head, state, targetSha,
300
308
  }
301
309
  }
302
310
 
311
+ /** @param {string} branch @param {string} stderr */
312
+ function reconciliationPullRequestCreateError(branch, stderr) {
313
+ const detail = sanitizeReconcileOutput(stderr) || 'unknown error'
314
+ const permissionHint = /github actions is not permitted to create or approve pull requests|resource not accessible by integration/i.test(detail)
315
+ ? ' Enable Settings > Actions > General > Workflow permissions > Allow GitHub Actions to create and approve pull requests, then rerun the workflow.'
316
+ : ''
317
+ return `gh pr create failed for ${branch}: ${detail}${permissionHint}`
318
+ }
319
+
303
320
  /**
304
321
  * Refresh an existing reconciliation pull request to the exact target tip and
305
322
  * body. The head branch is pushed under an exact lease when its tip is stale,