code-foundry 1.51.0 → 1.52.0

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.
@@ -227,7 +227,7 @@ Keep pull requests focused and reviewable. Include screenshots or recordings for
227
227
  | Exact Release Please PR targeting `main` | Release diff, configured CodeQL, build/package check, and either a verified receipt or full CI/tests |
228
228
  | Scheduled or manual validation | Full audit tier |
229
229
  | Push to a working branch | Draft PR workflow |
230
- | Push to `main` | Release workflow; CodeQL skips release-only merges (audit covers drift) |
230
+ | Push to `main` | Release workflow; CodeQL scans every push to main, all commits included |
231
231
 
232
232
  Draft pull requests do not start validation unless `draft_protection: false` is configured. The lightweight Draft Guard converts ordinary pull requests opened or reopened while ready back to draft; it never checks out pull-request code and it excludes Release Please version heads, whose release workflow owns their state. Marking a pull request ready for review starts the applicable validation tier, and each new commit on a ready pull request reruns that tier for the current head. Draft updates allocate no validation runner while protection is enabled. Converting a pull request to draft runs only the lightweight cancellation control.
233
233
 
@@ -35,6 +35,11 @@ on:
35
35
  required: false
36
36
  type: string
37
37
  default: ''
38
+ build-env:
39
+ description: 'Optional JSON object of non-secret environment variables for the build command only.'
40
+ required: false
41
+ type: string
42
+ default: '{}'
38
43
  bun-version:
39
44
  required: false
40
45
  type: string
@@ -267,10 +272,44 @@ jobs:
267
272
  working-directory: ${{ inputs.working-directory }}
268
273
  env:
269
274
  BUILD_SCRIPT: ${{ inputs.build-script }}
275
+ BUILD_ENV_JSON: ${{ inputs.build-env }}
270
276
  TURBO_API: ${{ vars.TURBO_API }}
271
277
  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
272
278
  TURBO_TEAM: ${{ vars.TURBO_TEAM }}
273
- run: bun run "$BUILD_SCRIPT"
279
+ run: |
280
+ node --input-type=module <<'NODE'
281
+ import { spawnSync } from 'node:child_process'
282
+ const input = process.env.BUILD_ENV_JSON
283
+ let buildEnv
284
+ try {
285
+ buildEnv = JSON.parse(input)
286
+ } catch {
287
+ throw new Error('build-env must be a JSON object of string values')
288
+ }
289
+ if (!buildEnv || typeof buildEnv !== 'object' || Array.isArray(buildEnv)) {
290
+ throw new Error('build-env must be a JSON object of string values')
291
+ }
292
+ const allowedNames = new Set([
293
+ 'ADEA_PREVIEW_HYPERDRIVE_ID',
294
+ 'ADEA_PREVIEW_SECRETS_STORE_ID',
295
+ 'ADEA_PREVIEW_DATABASE_URL_SECRET',
296
+ 'ADEA_PREVIEW_AUTH_BASE_URL_SECRET',
297
+ 'ADEA_PREVIEW_AUTH_COOKIE_SECRET_NAME',
298
+ 'ADEA_PREVIEW_AUTH_TRUSTED_ORIGINS_SECRET',
299
+ ])
300
+ for (const [name, value] of Object.entries(buildEnv)) {
301
+ if (!allowedNames.has(name)) {
302
+ throw new Error(`Invalid build-env variable name: ${name}`)
303
+ }
304
+ if (typeof value !== 'string') throw new Error(`build-env value for ${name} must be a string`)
305
+ }
306
+ const result = spawnSync('bun', ['run', process.env.BUILD_SCRIPT], {
307
+ stdio: 'inherit',
308
+ env: { ...process.env, ...buildEnv },
309
+ })
310
+ if (result.error) throw result.error
311
+ process.exit(result.status ?? 1)
312
+ NODE
274
313
  - name: Deploy to Cloudflare
275
314
  id: deploy
276
315
  if: steps.check.outputs.should_deploy != 'false'
@@ -21,13 +21,20 @@ jobs:
21
21
  runs-on: ubuntu-slim
22
22
  timeout-minutes: 5
23
23
  steps:
24
- - name: Cancel queued and running checks for this branch
24
+ - name: Cancel queued and running checks for this pull request
25
25
  env:
26
26
  GH_TOKEN: ${{ github.token }}
27
27
  HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
28
+ PR_NUMBER: ${{ github.event.pull_request.number }}
28
29
  CURRENT_RUN_ID: ${{ github.run_id }}
29
30
  run: |
30
31
  set -euo pipefail
32
+ if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
33
+ echo '::error title=Draft control cannot verify pull request::The event did not include a valid pull request number.'
34
+ exit 1
35
+ fi
36
+ # Only runs associated with this PR may be cancelled. Branch names can
37
+ # be shared by multiple PRs, including heads from different forks.
31
38
  for status in queued in_progress; do
32
39
  gh api "repos/$GITHUB_REPOSITORY/actions/runs" \
33
40
  --method GET \
@@ -35,7 +42,7 @@ jobs:
35
42
  -f event=pull_request \
36
43
  -f status="$status" \
37
44
  --paginate \
38
- --jq '.workflow_runs[].id' |
45
+ --jq ".workflow_runs[]? | select(any(.pull_requests[]?; .number == $PR_NUMBER)) | .id" |
39
46
  while read -r run_id; do
40
47
  if [ -n "$run_id" ] && [ "$run_id" -lt "$CURRENT_RUN_ID" ]; then
41
48
  gh api \
@@ -45,4 +52,4 @@ jobs:
45
52
  fi
46
53
  done
47
54
  done
48
- echo "CI is halted while pull request #${{ github.event.pull_request.number }} remains draft."
55
+ echo "CI is halted while pull request #$PR_NUMBER remains draft."
@@ -112,15 +112,12 @@ jobs:
112
112
 
113
113
  # CodeQL requires a push analysis to populate default-branch code-scanning
114
114
  # alerts. Keep the full validation gate pull-request-only so main pushes do
115
- # not duplicate CI, test, or security work. Release Please version merges
116
- # change manifests only, so the code tree is identical to the content merge
117
- # whose default-branch scan is still current; re-scanning it on every release
118
- # wastes the Rust-heavy analysis budget, and the scheduled audit covers drift.
115
+ # not duplicate CI, test, or security work. Run CodeQL for every main push:
116
+ # commit subjects do not prove that a push contains only release metadata.
119
117
  default-branch-codeql:
120
118
  name: CodeQL (default branch)
121
119
  if: >-
122
- vars.CI_BILLING_PAUSED != 'true' && github.event_name == 'push' &&
123
- !startsWith(github.event.head_commit.message, 'chore(main): release ')
120
+ vars.CI_BILLING_PAUSED != 'true' && github.event_name == 'push'
124
121
  permissions:
125
122
  actions: read
126
123
  contents: read
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.52.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.51.1...v1.52.0) (2026-10-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * scope Cloudflare build variables to build ([#802](https://github.com/0xPlayerOne/code-foundry/issues/802)) ([1f9a89f](https://github.com/0xPlayerOne/code-foundry/commit/1f9a89fa19a868732805a065fe90cc7609928a1e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * scope draft cancellation to its pull request ([#799](https://github.com/0xPlayerOne/code-foundry/issues/799)) ([ba42e81](https://github.com/0xPlayerOne/code-foundry/commit/ba42e811729e6ab8a82e2941abfdaab4f8544eed))
14
+
15
+ ## [1.51.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.51.0...v1.51.1) (2026-10-29)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **ci:** run CodeQL on every main push ([#797](https://github.com/0xPlayerOne/code-foundry/issues/797)) ([d6d299d](https://github.com/0xPlayerOne/code-foundry/commit/d6d299dd5b073d6a5e13ffc2aa016d856208d2e4))
21
+
3
22
  ## [1.51.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.50.1...v1.51.0) (2026-10-29)
4
23
 
5
24
 
@@ -126,23 +145,9 @@
126
145
 
127
146
  * validation-issue-read-v1471 ([#759](https://github.com/0xPlayerOne/code-foundry/issues/759)) ([7119b3e](https://github.com/0xPlayerOne/code-foundry/commit/7119b3e2baebfbfdd47d32428cbf5df2f2079afa))
128
147
 
129
- ## [1.47.4](https://github.com/0xPlayerOne/code-foundry/compare/v1.47.3...v1.47.4) (2026-10-15)
130
-
131
-
132
- ### Documentation
133
-
134
- * fix generated agent contribution and validation references ([#760](https://github.com/0xPlayerOne/code-foundry/issues/760)) ([c3564c9](https://github.com/0xPlayerOne/code-foundry/commit/c3564c92cb168449317afe2e40359144bf7a0c71))
135
-
136
- ## [1.47.3](https://github.com/0xPlayerOne/code-foundry/compare/v1.47.2...v1.47.3) (2026-10-09)
137
-
138
-
139
- ### Maintenance
140
-
141
- * **fleet:** point the manifest at the rollout worktrees and filter adea's actionlint ([#757](https://github.com/0xPlayerOne/code-foundry/issues/757)) ([55bae8b](https://github.com/0xPlayerOne/code-foundry/commit/55bae8bf99a022bfa03294972d89a3cca20a6203))
142
-
143
148
  <!-- code-foundry: packaged changelog -->
144
149
 
145
150
  ---
146
151
 
147
- This packaged changelog lists the 20 most recent releases; 264 older releases are omitted to keep the package small.
152
+ This packaged changelog lists the 20 most recent releases; 266 older releases are omitted to keep the package small.
148
153
  See the [full changelog](https://github.com/0xPlayerOne/code-foundry/blob/main/CHANGELOG.md) for the complete history.
@@ -34,8 +34,10 @@ and 118 files.
34
34
  On v1.50.1 base `f671dd8`, the measured artifact was 315,853 packed bytes,
35
35
  1,200,759 unpacked bytes, and 120 files. Release caller publication overrides
36
36
  measure 316,295 packed bytes, 1,222,905 unpacked bytes, and 120 files: an
37
- increase of 442 packed bytes and 22,146 unpacked bytes. The packed limit is
38
- 316,500 bytes, leaving 205 bytes of measured headroom; the unpacked and file-count
37
+ increase of 442 packed bytes and 22,146 unpacked bytes. The packed limit was
38
+ raised to 317,000 bytes for the optional build environment input in the
39
+ Cloudflare reusable workflow, which ships in the npm package. This leaves 235
40
+ bytes above the measured 316,765-byte artifact. The unpacked and file-count
39
41
  limits remain 1,225,000 bytes and 120 files.
40
42
 
41
43
  The published package ships a changelog trimmed to the 20 most recent releases
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "1.51.0",
3
+ "version": "1.52.0",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "homepage": "https://github.com/0xPlayerOne/code-foundry#readme",
6
6
  "bugs": {
@@ -1602,8 +1602,8 @@ const DIRECT_DOC_REPLACEMENTS = {
1602
1602
  '7. Push to the fork and open a pull request targeting `main`.',
1603
1603
  ],
1604
1604
  [
1605
- '| Event | Expected automation |\n| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| Draft pull request targeting `staging` | No runner-heavy validation; run local checks before requesting review |\n| Ready pull request targeting `staging` | Fast validation: CI plus unit tests, ending in `Validation / Gate` |\n| Draft ordinary pull request targeting `main` | No runner-heavy validation; run local checks before requesting review |\n| Ready ordinary pull request targeting `main` | Audit validation: CI, full tests, Security, and CodeQL, ending in `Validation / Gate` |\n| Exact Release Please PR targeting `main` | Release diff, configured CodeQL, build/package check, and either a verified receipt or full CI/tests |\n| Scheduled or manual validation | Full audit tier |\n| Push to a working branch | Draft PR workflow |\n| Push to `staging` | Promotion PR workflow; canonical validation waits for the PR event |\n| Push to `main` | Release workflow; CodeQL skips release-only merges (audit covers drift) |\n',
1606
- '| Event | Expected automation |\n| ---------------------------------------- | ---------------------------------------------------------------------------------------------------- |\n| Draft pull request targeting `main` | No runner-heavy validation; run local checks before requesting review |\n| Ready pull request targeting `main` | Audit validation: CI, full tests, Security, and CodeQL, ending in `Validation / Gate` |\n| Exact Release Please PR targeting `main` | Release diff, configured CodeQL, build/package check, and either a verified receipt or full CI/tests |\n| Scheduled or manual validation | Full audit tier |\n| Push to a working branch | Draft PR workflow |\n| Push to `main` | Release workflow; CodeQL skips release-only merges (audit covers drift) |\n',
1605
+ '| Event | Expected automation |\n| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| Draft pull request targeting `staging` | No runner-heavy validation; run local checks before requesting review |\n| Ready pull request targeting `staging` | Fast validation: CI plus unit tests, ending in `Validation / Gate` |\n| Draft ordinary pull request targeting `main` | No runner-heavy validation; run local checks before requesting review |\n| Ready ordinary pull request targeting `main` | Audit validation: CI, full tests, Security, and CodeQL, ending in `Validation / Gate` |\n| Exact Release Please PR targeting `main` | Release diff, configured CodeQL, build/package check, and either a verified receipt or full CI/tests |\n| Scheduled or manual validation | Full audit tier |\n| Push to a working branch | Draft PR workflow |\n| Push to `staging` | Promotion PR workflow; canonical validation waits for the PR event |\n| Push to `main` | Release workflow; CodeQL scans every push to main, all commits included |\n',
1606
+ '| Event | Expected automation |\n| ---------------------------------------- | ---------------------------------------------------------------------------------------------------- |\n| Draft pull request targeting `main` | No runner-heavy validation; run local checks before requesting review |\n| Ready pull request targeting `main` | Audit validation: CI, full tests, Security, and CodeQL, ending in `Validation / Gate` |\n| Exact Release Please PR targeting `main` | Release diff, configured CodeQL, build/package check, and either a verified receipt or full CI/tests |\n| Scheduled or manual validation | Full audit tier |\n| Push to a working branch | Draft PR workflow |\n| Push to `main` | Release workflow; CodeQL scans every push to main, all commits included |\n',
1607
1607
  ],
1608
1608
  [
1609
1609
  '| Change | Target | Merge method | Merge gate |\n| ---------------------------- | --------- | ----------------------------------------------- | --------------------------------------------------------- |\n| Working branch | `staging` | Squash | All applicable required checks pass |\n| `staging` → `main` promotion | `main` | Rebase (`merge_strategy`) | Current staging checks, release review, and rollout notes |\n| Release Please version PR | `main` | Rebase (`release_merge_strategy`, fails closed) | Validation gate and release policy pass |\n',