code-foundry 1.6.0 → 1.7.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.
- package/.github/CONTRIBUTING.md +1 -1
- package/.github/code-foundry.yml +2 -2
- package/.github/workflows/release-pr.yml +1 -1
- package/.github/workflows/validation_audit_self-ci.yml +43 -0
- package/.github/workflows/validation_self-ci.yml +4 -8
- package/CHANGELOG.md +14 -0
- package/docs/CONFIGURATION.md +2 -2
- package/docs/RELEASES.md +4 -5
- package/package.json +1 -1
- package/release-please-config.json +2 -0
- package/src/commands/sync.mjs +9 -8
package/.github/CONTRIBUTING.md
CHANGED
|
@@ -163,7 +163,7 @@ Keep pull requests focused and reviewable. Include screenshots or recordings for
|
|
|
163
163
|
| Push to `staging` | Promotion PR workflow; canonical validation waits for the PR event |
|
|
164
164
|
| Push to `main` | Release workflow; canonical validation already ran on the merged PR |
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
Pull-request validation keys concurrency by event and pull-request head, so a newer update cancels its superseded run. Scheduled and manual audits use a separate caller pinned to the protected default branch; this prevents caller-selected runtime code from executing with default-branch cache access. Both callers use the mode-aware orchestrator, which fans out only the required jobs and concludes with the stable aggregate gate.
|
|
167
167
|
|
|
168
168
|
Required checks are enforced by branch protection rulesets/branch protection. Do not duplicate their checklists in the pull request description; document validation commands and results instead.
|
|
169
169
|
|
package/.github/code-foundry.yml
CHANGED
|
@@ -16,8 +16,8 @@ release_type: node
|
|
|
16
16
|
npm_publish: true
|
|
17
17
|
license: agpl-3.0-or-later
|
|
18
18
|
git_workflow: direct
|
|
19
|
-
merge_strategy:
|
|
20
|
-
release_merge_strategy:
|
|
19
|
+
merge_strategy: squash
|
|
20
|
+
release_merge_strategy: squash
|
|
21
21
|
runner: ubuntu-latest
|
|
22
22
|
unit_runner: ubuntu-slim
|
|
23
23
|
performance_runner: ubuntu-latest
|
|
@@ -257,7 +257,7 @@ jobs:
|
|
|
257
257
|
--method POST
|
|
258
258
|
--field base=main
|
|
259
259
|
--field head="$PROMOTION_BRANCH"
|
|
260
|
-
--field title="
|
|
260
|
+
--field title="chore(main): promote staging to main ($DATE)"
|
|
261
261
|
--field body=@"$BODY_FILE"
|
|
262
262
|
)
|
|
263
263
|
if [ "$HAS_AUTOMATION_TOKEN" != true ]; then
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Code Foundry Audit
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '31 6 * * 1'
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions: {}
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: code-foundry-audit-${{ github.event_name }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# Default-branch-capable events must not call the local reusable workflow:
|
|
16
|
+
# a pull request could otherwise change that workflow and feed an untrusted
|
|
17
|
+
# runtime ref into steps that can populate the protected branch cache. Use
|
|
18
|
+
# the protected default branch for both workflow code and runtime code.
|
|
19
|
+
validation:
|
|
20
|
+
name: Validation
|
|
21
|
+
if: vars.CI_BILLING_PAUSED != 'true'
|
|
22
|
+
permissions:
|
|
23
|
+
actions: read
|
|
24
|
+
contents: read
|
|
25
|
+
packages: read
|
|
26
|
+
security-events: write
|
|
27
|
+
uses: 0xPlayerOne/code-foundry/.github/workflows/validation.yml@main
|
|
28
|
+
with:
|
|
29
|
+
mode: audit
|
|
30
|
+
runtime-repository: 0xPlayerOne/code-foundry
|
|
31
|
+
runtime-ref: main
|
|
32
|
+
ci-runner: ubuntu-latest
|
|
33
|
+
test-runner: ubuntu-latest
|
|
34
|
+
unit-runner: ubuntu-slim
|
|
35
|
+
performance-runner: ubuntu-latest
|
|
36
|
+
security-runner: ubuntu-slim
|
|
37
|
+
codeql-runner: ubuntu-latest
|
|
38
|
+
rust-shards: '["all"]'
|
|
39
|
+
rust-threads: '1'
|
|
40
|
+
rust-max-parallel: 1
|
|
41
|
+
secrets:
|
|
42
|
+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
43
|
+
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
|
|
@@ -8,16 +8,12 @@ on:
|
|
|
8
8
|
- synchronize
|
|
9
9
|
- reopened
|
|
10
10
|
- ready_for_review
|
|
11
|
-
schedule:
|
|
12
|
-
- cron: '31 6 * * 1'
|
|
13
|
-
workflow_dispatch:
|
|
14
11
|
|
|
15
12
|
# Default every caller job to no repository permissions. Individual jobs grant
|
|
16
13
|
# only the scopes their own validation path consumes.
|
|
17
14
|
permissions: {}
|
|
18
15
|
|
|
19
|
-
# Superseded PR updates cancel the previous run
|
|
20
|
-
# are keyed by event so periodic audits and manual runs stay independent.
|
|
16
|
+
# Superseded PR updates cancel the previous run.
|
|
21
17
|
concurrency:
|
|
22
18
|
group: code-foundry-validation-${{ github.event_name }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
|
|
23
19
|
cancel-in-progress: true
|
|
@@ -77,9 +73,9 @@ jobs:
|
|
|
77
73
|
mode: ${{ needs.mode.outputs.mode }}
|
|
78
74
|
runtime-repository: 0xPlayerOne/code-foundry
|
|
79
75
|
# Pull requests validate the proposed runtime commit. Scheduled and
|
|
80
|
-
# manually dispatched audits
|
|
81
|
-
# selected
|
|
82
|
-
runtime-ref: ${{ github.
|
|
76
|
+
# manually dispatched audits are isolated in validation_audit_self-ci.yml
|
|
77
|
+
# so this caller-selected ref never runs with default-branch cache access.
|
|
78
|
+
runtime-ref: ${{ github.sha }}
|
|
83
79
|
ci-runner: ubuntu-latest
|
|
84
80
|
test-runner: ubuntu-latest
|
|
85
81
|
unit-runner: ubuntu-slim
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.7.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.6.1...v1.7.0) (2026-09-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **release:** standardize generated PR titles ([#497](https://github.com/0xPlayerOne/code-foundry/issues/497)) ([44de0c4](https://github.com/0xPlayerOne/code-foundry/commit/44de0c4f1261a017a0395ddae268c203cccc71b4))
|
|
9
|
+
|
|
10
|
+
## [1.6.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.6.0...v1.6.1) (2026-09-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **ci:** isolate default-branch security audits ([5ea0914](https://github.com/0xPlayerOne/code-foundry/commit/5ea09146af9995f16d1ab4e9a73f14a13582da36))
|
|
16
|
+
|
|
3
17
|
## [1.6.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.5.4...v1.6.0) (2026-09-08)
|
|
4
18
|
|
|
5
19
|
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -98,8 +98,8 @@ present.
|
|
|
98
98
|
- `direct` (default): feature branches open pull requests directly into
|
|
99
99
|
`main`. Validation and security scans run on every PR. No `staging` branch
|
|
100
100
|
exists, no promotion caller is generated, and `merge_strategy` is not
|
|
101
|
-
enforced. Release Please version PRs
|
|
102
|
-
|
|
101
|
+
enforced. Release Please version PRs squash into `main`
|
|
102
|
+
(`release_merge_strategy: squash`). Dependabot updates target `main`. This is
|
|
103
103
|
the right choice when a repository has no preview or staging environment.
|
|
104
104
|
- `staging-release` (opt-in): feature branches squash into `staging`, a
|
|
105
105
|
promotion PR rebases validated changes into `main` (`merge_strategy:
|
package/docs/RELEASES.md
CHANGED
|
@@ -24,9 +24,8 @@ topology, feature and fix branches land on `staging` with **squash** merges,
|
|
|
24
24
|
the `staging` → `main` promotion PR merges with **rebase** (`merge_strategy:
|
|
25
25
|
rebase`), and Release Please version PRs merge with **rebase**
|
|
26
26
|
(`release_merge_strategy: rebase`). In the `direct` topology, feature and fix
|
|
27
|
-
branches squash straight into `main` and Release Please version PRs
|
|
28
|
-
|
|
29
|
-
opted in). `merge_strategy` is not enforced. Release automation never defaults
|
|
27
|
+
branches squash straight into `main` and Release Please version PRs squash into
|
|
28
|
+
`main` (`release_merge_strategy: squash`). `merge_strategy` is not enforced. Release automation never defaults
|
|
30
29
|
to a merge method and never merges with `--admin`: `staging-release` accepts
|
|
31
30
|
only rebase for release PRs, while `direct` accepts rebase or squash.
|
|
32
31
|
|
|
@@ -46,7 +45,7 @@ release_type: auto # auto, node, python, rust, simple, or none
|
|
|
46
45
|
npm_publish: false # true only for an npm package
|
|
47
46
|
git_workflow: direct # direct (default) or staging-release
|
|
48
47
|
merge_strategy: rebase # staging-release only: staging -> main promotion PRs rebase
|
|
49
|
-
release_merge_strategy:
|
|
48
|
+
release_merge_strategy: squash # direct default; staging-release requires rebase
|
|
50
49
|
```
|
|
51
50
|
|
|
52
51
|
`git_workflow: staging-release` is opt-in; without it, repositories use the
|
|
@@ -136,6 +135,6 @@ already passed).
|
|
|
136
135
|
|
|
137
136
|
1. Merge tested changes into `main` (direct: feature PRs; staging-release: promote `staging` into `main`).
|
|
138
137
|
2. Review the generated Release Please PR and changelog.
|
|
139
|
-
3. Merge the release PR with the
|
|
138
|
+
3. Merge the release PR with squash in the direct topology (`release_merge_strategy: squash`).
|
|
140
139
|
4. Confirm the GitHub Release and any package publication.
|
|
141
140
|
5. staging-release only: synchronize `staging` with the new `main` release commit.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-foundry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.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": {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
|
3
3
|
"bump-minor-pre-major": true,
|
|
4
|
+
"pull-request-title-pattern": "chore(main): release ${version}",
|
|
5
|
+
"group-pull-request-title-pattern": "chore(main): release ${version}",
|
|
4
6
|
"changelog-sections": [
|
|
5
7
|
{ "type": "feat", "section": "Features" },
|
|
6
8
|
{ "type": "fix", "section": "Bug Fixes" },
|
package/src/commands/sync.mjs
CHANGED
|
@@ -108,7 +108,7 @@ export function syncRepository(options) {
|
|
|
108
108
|
const existingConfig = readConfig(configPath)
|
|
109
109
|
if (!Object.keys(existingConfig).length && !options.init)
|
|
110
110
|
throw new Error('Missing .github/code-foundry.yml; run init first.')
|
|
111
|
-
const defaults = createDefaultConfig(target, source)
|
|
111
|
+
const defaults = createDefaultConfig(target, source, existingConfig.git_workflow)
|
|
112
112
|
let config = { ...defaults, ...existingConfig }
|
|
113
113
|
// Resolve and validate the license policy before any sync writes occur
|
|
114
114
|
// (including config/default additions) so an unsupported policy fails
|
|
@@ -658,7 +658,7 @@ const DIRECT_DOC_REPLACEMENTS = {
|
|
|
658
658
|
],
|
|
659
659
|
[
|
|
660
660
|
'This repository uses the `staging-release` workflow: topic branches **squash** into `staging`, a promotion PR **rebases** validated changes into `main` (`merge_strategy: rebase`), and the Release Please version PR **rebases** into `main` (`release_merge_strategy: rebase`). Feature PRs land on `staging` with squash merges; promotion and release PRs land on `main` with rebase merges. Re-align `staging` with `main` after a release when needed.',
|
|
661
|
-
'This repository uses the `direct` workflow: topic branches **squash** directly into `main`, and the Release Please version PR
|
|
661
|
+
'This repository uses the `direct` workflow: topic branches **squash** directly into `main`, and the Release Please version PR **squashes** into `main` (`release_merge_strategy: squash`). Feature and release PRs land on `main` with squash merges. No integration branch exists; all pull requests target `main`.',
|
|
662
662
|
],
|
|
663
663
|
],
|
|
664
664
|
'.github/CONTRIBUTING.md': [
|
|
@@ -676,7 +676,7 @@ const DIRECT_DOC_REPLACEMENTS = {
|
|
|
676
676
|
],
|
|
677
677
|
[
|
|
678
678
|
'The Git workflow is `staging-release`: topic branches **squash** into `staging`, a promotion PR **rebases** validated changes into `main` (`merge_strategy: rebase`), and the Release Please version PR **rebases** into `main` (`release_merge_strategy: rebase`). Release automation never defaults to a merge method and never merges with `--admin`; `code-foundry doctor` and `code-foundry sync` fail closed on any other merge strategy. Re-align `staging` with `main` after a release when needed.',
|
|
679
|
-
'The Git workflow is `direct`: topic branches **squash** directly into `main`, and the Release Please version PR
|
|
679
|
+
'The Git workflow is `direct`: topic branches **squash** directly into `main`, and the Release Please version PR **squashes** into `main` (`release_merge_strategy: squash`). Release automation never defaults to a merge method and never merges with `--admin`; `code-foundry doctor` and `code-foundry sync` fail closed on any other release merge strategy. Feature branches never touch `staging`; repositories with a preview/staging environment opt into `git_workflow: staging-release` explicitly.',
|
|
680
680
|
],
|
|
681
681
|
[
|
|
682
682
|
'git switch staging\ngit pull --ff-only origin staging',
|
|
@@ -702,7 +702,7 @@ const DIRECT_DOC_REPLACEMENTS = {
|
|
|
702
702
|
],
|
|
703
703
|
[
|
|
704
704
|
'| 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',
|
|
705
|
-
'| Change | Target | Merge method | Merge gate |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Working branch | `main` | Squash | All applicable required checks pass |\n| Release Please version PR | `main` |
|
|
705
|
+
'| Change | Target | Merge method | Merge gate |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Working branch | `main` | Squash | All applicable required checks pass |\n| Release Please version PR | `main` | Squash (`release_merge_strategy`) | Validation gate and release policy pass |',
|
|
706
706
|
],
|
|
707
707
|
['1. Create a focused branch from `staging`.', '1. Create a focused branch from `main`.'],
|
|
708
708
|
],
|
|
@@ -1068,11 +1068,12 @@ function buffersEqual(a, b) {
|
|
|
1068
1068
|
return a.equals(b)
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
1071
|
-
/** @param {string} root @param {string} source @returns {Record<string,string>} */
|
|
1072
|
-
function createDefaultConfig(root, source) {
|
|
1071
|
+
/** @param {string} root @param {string} source @param {string|undefined} configuredWorkflow @returns {Record<string,string>} */
|
|
1072
|
+
function createDefaultConfig(root, source, configuredWorkflow) {
|
|
1073
1073
|
const languages = detectLanguages(root).join(',')
|
|
1074
1074
|
const packageManager = detectPackageManager(root)
|
|
1075
1075
|
const runners = recommendRunners(root)
|
|
1076
|
+
const stagingRelease = configuredWorkflow === 'staging-release'
|
|
1076
1077
|
return {
|
|
1077
1078
|
version: '1',
|
|
1078
1079
|
profile: detectProfile(root),
|
|
@@ -1107,8 +1108,8 @@ function createDefaultConfig(root, source) {
|
|
|
1107
1108
|
custom_workflows: 'preserve',
|
|
1108
1109
|
license: existsSync(join(root, 'LICENSE')) ? 'preserve' : 'gpl-3.0-or-later',
|
|
1109
1110
|
git_workflow: 'direct',
|
|
1110
|
-
merge_strategy: 'rebase',
|
|
1111
|
-
release_merge_strategy: 'rebase',
|
|
1111
|
+
merge_strategy: stagingRelease ? 'rebase' : 'squash',
|
|
1112
|
+
release_merge_strategy: stagingRelease ? 'rebase' : 'squash',
|
|
1112
1113
|
}
|
|
1113
1114
|
}
|
|
1114
1115
|
|