code-foundry 1.20.2 → 1.22.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.
- package/.github/CONTRIBUTING.md +5 -2
- package/.github/code-foundry.yml +1 -0
- package/.github/release-please-foundry.json +56 -0
- package/.github/workflows/cloudflare-delivery.yml +9 -0
- package/.github/workflows/cloudflare-deploy.yml +8 -1
- package/.github/workflows/opencode-security_self-ci.yml +1 -1
- package/.github/workflows/qualified-foundry-publish.yml +6 -7
- package/.github/workflows/release.yml +58 -10
- package/.github/workflows/release_self-ci.yml +211 -8
- package/.gitignore +1 -1
- package/AGENTS.md +4 -1
- package/CHANGELOG.md +53 -0
- package/README.md +20 -17
- package/docs/CONFIGURATION.md +182 -152
- package/docs/EXTENSIONS.md +28 -7
- package/docs/INITIALIZATION.md +13 -9
- package/docs/PERFORMANCE.md +67 -59
- package/docs/PUBLISHING.md +39 -14
- package/docs/README.md +37 -22
- package/docs/RELEASES.md +18 -9
- package/docs/WORKFLOWS.md +11 -0
- package/docs/agent-validation.md +6 -5
- package/docs/cloudflare-delivery.md +20 -8
- package/docs/consumer-qualification.md +11 -9
- package/docs/fleet-release-eligibility.md +14 -15
- package/docs/fleet-rollouts.md +3 -3
- package/docs/merge-queues.md +21 -21
- package/docs/product-quality.md +9 -10
- package/docs/qualified-publication.md +166 -93
- package/docs/release-integrity.md +7 -6
- package/docs/required-capabilities.md +19 -12
- package/package.json +1 -1
- package/src/commands/cloudflare-delivery.mjs +6 -1
- package/src/commands/qualified-publication.mjs +23 -10
- package/src/commands/release-integrity.mjs +9 -0
- package/src/commands/sync.mjs +29 -24
- package/src/lib/product-quality.mjs +220 -16
- package/src/runtime-core.mjs +12 -8
- package/src/runtime.mjs +1 -1
- package/src/templates/gitignore +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.22.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.22.0...v1.22.1) (2026-09-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **release:** use shell-safe recovery script ([#574](https://github.com/0xPlayerOne/code-foundry/issues/574)) ([264036f](https://github.com/0xPlayerOne/code-foundry/commit/264036f34afa4d7bc405285918395f2ce075bde3))
|
|
9
|
+
|
|
10
|
+
## [1.22.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.21.3...v1.22.0) (2026-09-09)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **workflows:** protect draft pull requests by default ([#572](https://github.com/0xPlayerOne/code-foundry/issues/572)) ([6fa4ce1](https://github.com/0xPlayerOne/code-foundry/commit/6fa4ce1b2dde5eddff361b819722912fed7a9815))
|
|
16
|
+
|
|
17
|
+
## [1.21.3](https://github.com/0xPlayerOne/code-foundry/compare/v1.21.2...v1.21.3) (2026-09-09)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **release:** unblock draft publication and PR deployment links ([#570](https://github.com/0xPlayerOne/code-foundry/issues/570)) ([35ab90f](https://github.com/0xPlayerOne/code-foundry/commit/35ab90f185483b0cd6a9c622b9793e46c90dd60c))
|
|
23
|
+
|
|
24
|
+
## [1.21.2](https://github.com/0xPlayerOne/code-foundry/compare/v1.21.1...v1.21.2) (2026-09-09)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
|
|
29
|
+
* refresh documentation for current workflows ([#568](https://github.com/0xPlayerOne/code-foundry/issues/568)) ([d0028e0](https://github.com/0xPlayerOne/code-foundry/commit/d0028e096371e1019c466f72f8744bdf832e067c))
|
|
30
|
+
|
|
31
|
+
## [1.21.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.21.0...v1.21.1) (2026-09-09)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* release-hook-and-performance-safety ([#565](https://github.com/0xPlayerOne/code-foundry/issues/565)) ([0d410c6](https://github.com/0xPlayerOne/code-foundry/commit/0d410c68abfbc0d9fdd03b7aa81676489e459c19))
|
|
37
|
+
* **release:** automate self publication after CI ([91b2655](https://github.com/0xPlayerOne/code-foundry/commit/91b265585aa03e742e5bfc8a839b2794bf234491))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Performance
|
|
41
|
+
|
|
42
|
+
* **ci:** batch native Rust test targets by category ([#564](https://github.com/0xPlayerOne/code-foundry/issues/564)) ([6def882](https://github.com/0xPlayerOne/code-foundry/commit/6def8826e90b23d021a4f4587fa843dbb37df0e7))
|
|
43
|
+
|
|
44
|
+
## [1.21.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.20.2...v1.21.0) (2026-09-09)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
* **release:** wire qualified draft staging and immutable publication ([#558](https://github.com/0xPlayerOne/code-foundry/issues/558)) ([19aea32](https://github.com/0xPlayerOne/code-foundry/commit/19aea32f50c747cdc5642d1752a9f02008c157f6))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* **quality:** harden HTML filtering ([#562](https://github.com/0xPlayerOne/code-foundry/issues/562)) ([ea45590](https://github.com/0xPlayerOne/code-foundry/commit/ea45590db24dc05ef12db57e80c7405fa217514f))
|
|
55
|
+
|
|
3
56
|
## [1.20.2](https://github.com/0xPlayerOne/code-foundry/compare/v1.20.1...v1.20.2) (2026-09-09)
|
|
4
57
|
|
|
5
58
|
|
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ preserved and can coexist with the standard baseline.
|
|
|
58
58
|
The generated configuration is the one place to control the baseline. See
|
|
59
59
|
[Configuration reference](docs/CONFIGURATION.md) for the visual configuration
|
|
60
60
|
guide and [Initialization and synchronization](docs/INITIALIZATION.md) for
|
|
61
|
-
the
|
|
61
|
+
the init, sync, and doctor workflow.
|
|
62
62
|
|
|
63
63
|
New repositories default to GPL-3.0-or-later. Existing projects preserve an
|
|
64
64
|
authored license unless a replacement is explicitly selected. Our maintained
|
|
@@ -82,9 +82,11 @@ PRs: it converts them to drafts without checking out PR code. It verifies the
|
|
|
82
82
|
event head and update timestamp before changing state, and excludes Release
|
|
83
83
|
Please version PRs whose release workflow owns readiness. Pull-request
|
|
84
84
|
validation runs on the ready-for-review transition and on new commits while a
|
|
85
|
-
PR remains ready; draft updates allocate no validation runner
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
PR remains ready; draft updates allocate no validation runner by default. Set
|
|
86
|
+
`draft_protection: false` in generated consumer configuration, or pass
|
|
87
|
+
`draft-protection: false` to a Cloudflare reusable workflow, to run those gates
|
|
88
|
+
for drafts. Converting a PR to draft runs only the lightweight cancellation
|
|
89
|
+
control. Scheduled and manually dispatched audits are unaffected.
|
|
88
90
|
|
|
89
91
|
Jobs are language-aware and skip irrelevant setup inside the applicable
|
|
90
92
|
aggregate checks. TypeScript uses Oxlint, Oxfmt, and Bun's native
|
|
@@ -125,9 +127,16 @@ workflow runs.
|
|
|
125
127
|
In the default `direct` flow, changes reach `main` through feature pull
|
|
126
128
|
requests and Release Please opens a versioned release PR against `main`. In
|
|
127
129
|
the `staging-release` flow, a promotion PR promotes `staging` into `main`
|
|
128
|
-
first.
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
first. Generated consumer callers create a GitHub release after the version PR
|
|
131
|
+
is merged; npm publication is opt-in through `npm_publish: true` and supports
|
|
132
|
+
npm trusted publishing or an `NPM_TOKEN` fallback.
|
|
133
|
+
|
|
134
|
+
Code Foundry's own release caller is stricter: it qualifies the package across
|
|
135
|
+
Node 20, 22, and 24, stages the exact qualified archive, publishes the
|
|
136
|
+
immutable GitHub Release, and publishes that archive through the verified
|
|
137
|
+
publisher. See
|
|
138
|
+
[Consumer qualification](docs/consumer-qualification.md) and [Qualified
|
|
139
|
+
publication](docs/qualified-publication.md).
|
|
131
140
|
|
|
132
141
|
Read [Release management](docs/RELEASES.md),
|
|
133
142
|
[Release integrity and build provenance](docs/release-integrity.md), and
|
|
@@ -137,16 +146,10 @@ copied into other repositories.
|
|
|
137
146
|
|
|
138
147
|
## Documentation and extensions
|
|
139
148
|
|
|
140
|
-
The `docs/` directory contains generalized operational guides.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
- [Documentation index](docs/README.md)
|
|
145
|
-
- [Initialization and synchronization](docs/INITIALIZATION.md)
|
|
146
|
-
- [Workflow and CI conventions](docs/WORKFLOWS.md)
|
|
147
|
-
- [Release management](docs/RELEASES.md)
|
|
148
|
-
- [Publishing packages](docs/PUBLISHING.md)
|
|
149
|
-
- [Caching and remote caching](docs/CACHING.md)
|
|
149
|
+
The `docs/` directory contains generalized operational guides. Start with the
|
|
150
|
+
[documentation index](docs/README.md), which groups every guide by task. Add
|
|
151
|
+
repository-specific documentation there as well; synchronization preserves
|
|
152
|
+
files in `docs/`.
|
|
150
153
|
|
|
151
154
|
## License
|
|
152
155
|
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
# Configuration reference
|
|
2
2
|
|
|
3
|
-
Code Foundry has one repository-owned control plane:
|
|
3
|
+
Code Foundry has one repository-owned control plane:
|
|
4
|
+
`.github/code-foundry.yml`. `init` creates it, `sync` renders the selected
|
|
5
|
+
baseline, and `doctor` checks local and GitHub-facing prerequisites.
|
|
4
6
|
|
|
5
|
-
```
|
|
7
|
+
```sh
|
|
6
8
|
npx code-foundry init
|
|
9
|
+
# edit .github/code-foundry.yml
|
|
10
|
+
npx code-foundry sync
|
|
11
|
+
npx code-foundry doctor
|
|
7
12
|
```
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
The generated file is deliberately explicit. Keep it under version control and
|
|
15
|
+
change it directly rather than passing one-off flags to `sync`.
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
selects native setup for the detected languages. Use `toolchain: native` to
|
|
14
|
-
prohibit mise or `toolchain: mise` to require it.
|
|
15
|
-
|
|
16
|
-
## Configuration flow
|
|
17
|
+
## How configuration is applied
|
|
17
18
|
|
|
18
19
|
```text
|
|
19
20
|
repository manifests and source
|
|
@@ -21,181 +22,210 @@ repository manifests and source
|
|
|
21
22
|
v
|
|
22
23
|
.github/code-foundry.yml
|
|
23
24
|
|
|
|
24
|
-
+-->
|
|
25
|
+
+--> detected language and package-manager setup
|
|
25
26
|
+--> standard workflow callers
|
|
26
27
|
+--> runtime repository and version
|
|
27
|
-
+--> release, license,
|
|
28
|
+
+--> validation, release, license, and cache policy
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
31
|
+
`toolchain: auto` reuses an existing `.mise.toml`; otherwise it uses native
|
|
32
|
+
language tooling. Set `toolchain: native` to prohibit mise or `toolchain: mise`
|
|
33
|
+
to require an existing mise configuration.
|
|
34
|
+
|
|
35
|
+
## Repository and runtime
|
|
36
|
+
|
|
37
|
+
| Key | Values | Notes |
|
|
38
|
+
| ----------------------- | -------------------------------------------- | -------------------------------------------------------------------- |
|
|
39
|
+
| `version` | `1` | Configuration schema version. |
|
|
40
|
+
| `profile` | `auto`, `application`, `monorepo`, `minimal` | Repository shape; `auto` detects it. |
|
|
41
|
+
| `languages` | comma-separated language names | Supported values are `typescript`, `rust`, `python`, and `solidity`. |
|
|
42
|
+
| `package_manager` | `bun`, `pnpm`, `yarn`, `npm`, `none` | JavaScript package-manager policy. |
|
|
43
|
+
| `toolchain` | `auto`, `native`, `mise` | Environment setup policy. |
|
|
44
|
+
| `runtime_repository` | `OWNER/REPO` | Source of reusable workflows and runtime code. |
|
|
45
|
+
| `runtime_ref` | tag or commit | Runtime version used by generated callers. |
|
|
46
|
+
| `features` | `all` or a list | See [Feature selection](#feature-selection). |
|
|
47
|
+
| `draft_protection` | `true`, `false` | Skip generated runner-heavy gates for draft PRs when false. |
|
|
48
|
+
| `codeql` | `auto`, `true`, `false` | Enable CodeQL when the repository and GitHub plan support it. |
|
|
49
|
+
| `dependency_review` | `auto`, `true`, `false` | Enable Dependency Review when supported. |
|
|
50
|
+
| `runner` and `*_runner` | GitHub runner labels | Override the default runner per workflow. |
|
|
51
|
+
|
|
52
|
+
For `codeql: auto` and `dependency_review: auto`, public repositories use the
|
|
53
|
+
available GitHub security checks and private repositories require the relevant
|
|
54
|
+
capability. Set either key to `false` when the check is unavailable or not
|
|
55
|
+
wanted. CodeQL is omitted from the generated validation caller; Dependency
|
|
56
|
+
Review remains a conditional step inside Security rather than a separate check.
|
|
57
|
+
|
|
58
|
+
Code Foundry runner-heavy validation, security, qualification, and Cloudflare
|
|
59
|
+
Deployment jobs protect draft pull requests by default. The `draft_protection`
|
|
60
|
+
configuration key defaults to `true`; set it to `false` only when the repository
|
|
61
|
+
intentionally runs generated gates for draft PRs. Cloudflare reusable-workflow
|
|
62
|
+
callers use their equivalent `draft-protection` input. These opt-outs affect
|
|
63
|
+
CI/deployment gates only and do not disable Draft Guard or draft-PR automation.
|
|
64
|
+
|
|
65
|
+
## Feature selection
|
|
66
|
+
|
|
67
|
+
Use `features: all` or a comma/space-separated list. The canonical validation
|
|
68
|
+
feature is `validation`; the legacy names `ci`, `test`, `security`, and `codeql`
|
|
69
|
+
remain aliases for compatibility. Other selectable features are:
|
|
70
|
+
|
|
71
|
+
- `draft-pr` — create or update development pull requests.
|
|
72
|
+
- `release-pr` — promote `staging` into `main` in the `staging-release` topology.
|
|
73
|
+
- `release` — run Release Please and optional package publication.
|
|
74
|
+
- `dependabot` — install the language-aware Dependabot configuration.
|
|
75
|
+
|
|
76
|
+
The release-integrity and OpenCode Security callers are installed independently
|
|
77
|
+
of feature selection. OpenCode Security is disabled unless the repository or
|
|
78
|
+
organization variable `OPENCODE_SECURITY` is `true` and the
|
|
79
|
+
`OPENCODE_API_KEY` secret exists. `opencode_security_model` optionally replaces
|
|
80
|
+
the generated scanner model.
|
|
81
|
+
|
|
82
|
+
Merge queues are a separate opt-in because they need a stable runtime pin:
|
|
74
83
|
|
|
75
84
|
```yaml
|
|
76
|
-
|
|
77
|
-
performance_command: '["python3","scripts/performance_audit.py","--check"]'
|
|
78
|
-
performance_runner: ubuntu-latest
|
|
85
|
+
merge_queue: true
|
|
79
86
|
```
|
|
80
87
|
|
|
81
|
-
|
|
88
|
+
See [Merge queue validation](merge-queues.md) before enabling it.
|
|
89
|
+
|
|
90
|
+
## Validation and quality
|
|
91
|
+
|
|
92
|
+
| Key | Values | Purpose |
|
|
93
|
+
| ------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
94
|
+
| `performance` | `auto`, `true`, `false` | Discover, require, or disable performance checks. |
|
|
95
|
+
| `performance_command` | JSON argv array or array of argv arrays | Ordered commands for a non-package performance harness. |
|
|
96
|
+
| `performance_profile` | empty or `node-package` | Shared package import, memory, archive, and dependency audit. |
|
|
97
|
+
| `performance_budget_file` | repository-relative path | Budget file for `node-package`; defaults to `performance-package-budgets.json`. |
|
|
98
|
+
| `required_capabilities` | comma-separated task names | Fail closed when a required task or coverage evidence is unavailable. |
|
|
99
|
+
| `coverage_enforcement` | `auto`, `required`, `off` | Shared coverage-report policy. |
|
|
100
|
+
| `coverage_minimum` | `0`–`100` | Minimum percentage; defaults to `80`. |
|
|
101
|
+
| `coverage_metrics` | `lines`, `functions`, `branches`, `statements` | Metrics checked by the coverage gate. |
|
|
102
|
+
| `coverage_report` | comma-separated repository paths | Istanbul JSON summary or LCOV evidence files. |
|
|
103
|
+
|
|
104
|
+
Supported task capabilities are `format`, `lint`, `type_check`, `build`, `unit`,
|
|
105
|
+
`integration`, `e2e`, `smoke`, and `performance`. `coverage` is a policy
|
|
106
|
+
capability that also requires unit tests. See [Required capabilities and task
|
|
107
|
+
evidence](required-capabilities.md).
|
|
108
|
+
|
|
109
|
+
The shared performance job discovers `performance:check`, then `perf:check`,
|
|
110
|
+
in JavaScript repositories. Other repositories can provide one command or an
|
|
111
|
+
ordered list of argv arrays without shell interpolation:
|
|
82
112
|
|
|
83
113
|
```yaml
|
|
84
114
|
performance: true
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"schemaVersion": 1,
|
|
92
|
-
"importTarget": "./dist/index.js",
|
|
93
|
-
"controlImport": "typebox",
|
|
94
|
-
"samples": 7,
|
|
95
|
-
"budgets": {
|
|
96
|
-
"coldImportP95Ms": 150,
|
|
97
|
-
"coldImportRssMaxBytes": 25000000,
|
|
98
|
-
"packedBytes": 500000,
|
|
99
|
-
"productionDependencyCount": 20
|
|
100
|
-
}
|
|
101
|
-
}
|
|
115
|
+
performance_command: '["python3", "scripts/performance_audit.py", "--check"]'
|
|
116
|
+
performance_runner: ubuntu-latest
|
|
102
117
|
```
|
|
103
118
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
`
|
|
107
|
-
`
|
|
108
|
-
`
|
|
109
|
-
`performance-results
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
`
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`git_workflow` selects the branch topology:
|
|
135
|
-
|
|
136
|
-
- `direct` (default): feature branches open pull requests directly into
|
|
137
|
-
`main`. Validation and security scans run on every PR. No `staging` branch
|
|
138
|
-
exists, no promotion caller is generated, and `merge_strategy` must be
|
|
139
|
-
`squash`. Release Please version PRs squash into `main`
|
|
140
|
-
(`release_merge_strategy: squash`). Dependabot updates target `main`. This is
|
|
141
|
-
the right choice when a repository has no preview or staging environment.
|
|
142
|
-
- `staging-release` (opt-in): feature branches squash into `staging`, a
|
|
143
|
-
promotion PR rebases validated changes into `main` (`merge_strategy:
|
|
144
|
-
rebase`), and Release Please version PRs rebase into `main`
|
|
145
|
-
(`release_merge_strategy: rebase`). Choose this only when the repository
|
|
146
|
-
maintains a preview/staging environment that needs validated integration
|
|
147
|
-
before release.
|
|
119
|
+
The `node-package` profile supports cold-import, memory, package-size, file-count,
|
|
120
|
+
and production-dependency budgets. Supported budget names are
|
|
121
|
+
`coldImportP50Ms`, `coldImportP95Ms`, `coldImportRssMaxBytes`,
|
|
122
|
+
`coldImportRelativeP50`, `packedBytes`, `unpackedBytes`, `packageFileCount`,
|
|
123
|
+
`packageMapFileCount`, and `productionDependencyCount`. Reports are written under
|
|
124
|
+
`performance-results/` and are uploaded when present.
|
|
125
|
+
|
|
126
|
+
`performance: true` makes the performance task required. Use `performance: auto`
|
|
127
|
+
to keep discovery optional. Product-quality profiles are repository-owned
|
|
128
|
+
manifests invoked by existing build or E2E commands; they are not activated by a
|
|
129
|
+
configuration key. See [Product quality profiles](product-quality.md).
|
|
130
|
+
|
|
131
|
+
## Release and branch policy
|
|
132
|
+
|
|
133
|
+
| Key | Values | Purpose |
|
|
134
|
+
| ------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
135
|
+
| `release_type` | `auto`, `node`, `python`, `rust`, `simple`, `none` | Select a release manifest; `auto` detects one. |
|
|
136
|
+
| `npm_publish` | `true`, `false` | Opt into npm publication. |
|
|
137
|
+
| `license` | `gpl-3.0-or-later`, `agpl-3.0-or-later`, `apache-2.0`, `mit`, `preserve`, `none` | License policy for initialized repositories. |
|
|
138
|
+
| `git_workflow` | `direct`, `staging-release` | Choose the branch topology. |
|
|
139
|
+
| `merge_strategy` | `squash` or `rebase` | Required topology-specific merge method. |
|
|
140
|
+
| `release_merge_strategy` | `squash` or `rebase` | Required method for Release Please version PRs. |
|
|
141
|
+
| `staging_validation_mode` | `fast`, `audit` | Validation tier for pull requests into `staging`; staging-release only. |
|
|
142
|
+
|
|
143
|
+
`direct` is the default: feature branches and release PRs target `main`, and
|
|
144
|
+
both merge with squash. `staging-release` sends feature branches to `staging`,
|
|
145
|
+
uses rebase for the `staging` → `main` promotion and Release Please PR, and
|
|
146
|
+
keeps feature PRs into `staging` on squash. `sync`, `doctor`, and release
|
|
147
|
+
automation reject a strategy that does not match the selected topology.
|
|
148
148
|
|
|
149
149
|
```yaml
|
|
150
|
-
#
|
|
150
|
+
# Preview/staging environment
|
|
151
|
+
release_type: auto
|
|
151
152
|
git_workflow: staging-release
|
|
153
|
+
staging_validation_mode: fast
|
|
154
|
+
merge_strategy: rebase
|
|
155
|
+
release_merge_strategy: rebase
|
|
152
156
|
```
|
|
153
157
|
|
|
154
|
-
|
|
158
|
+
Use `simple` with `version.txt` when no package manifest exists. Use `none` to
|
|
159
|
+
skip automated releases. `npm_publish` affects generated consumer release
|
|
160
|
+
callers; Code Foundry's own repository uses the qualified publication path
|
|
161
|
+
described in [Qualified publication](qualified-publication.md).
|
|
162
|
+
|
|
163
|
+
## Synchronization and extensions
|
|
164
|
+
|
|
165
|
+
| Key | Values | Purpose |
|
|
166
|
+
| ----------------------- | -------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
167
|
+
| `sync_mode` | `overlay`, `strict` | Synchronization policy; `overlay` is the default. |
|
|
168
|
+
| `custom_workflows` | `preserve` | Custom workflows are always preserved; other values are rejected. |
|
|
169
|
+
| `post_release` | `true`, `auto`, `false` | Enable a post-release delivery hook. |
|
|
170
|
+
| `post_release_workflow` | workflow filename | Workflow dispatched by the post-release hook. |
|
|
171
|
+
| `post_release_mode` | `auto`, `workflow-dispatch`, `release-event`, `disabled` | Select the hook delivery mechanism. |
|
|
172
|
+
|
|
173
|
+
`sync_mode` accepts `overlay` (the default) or `strict`; `sync` validates the
|
|
174
|
+
selected value before writing. Custom workflows remain preserved in either mode,
|
|
175
|
+
and `custom_workflows` must remain `preserve`. See [Extension points](EXTENSIONS.md).
|
|
176
|
+
|
|
177
|
+
## Caching and remote caching
|
|
178
|
+
|
|
179
|
+
The standard workflows use lockfile- and configuration-keyed caches. Their
|
|
180
|
+
repository variables, rather than application source files, control cache
|
|
181
|
+
behavior:
|
|
155
182
|
|
|
156
|
-
|
|
183
|
+
- `REPO_FOUNDRY_CACHE_PACKAGES` controls package-store caching.
|
|
184
|
+
- `REPO_FOUNDRY_CACHE_BUILD` controls build-cache reuse.
|
|
185
|
+
- `turbo_remote: auto`, `true`, or `false` declares the remote-cache policy;
|
|
186
|
+
`doctor --github` warns when enabled remote caching lacks `TURBO_TOKEN` or
|
|
187
|
+
`TURBO_TEAM`.
|
|
188
|
+
- `TURBO_TOKEN` and `TURBO_TEAM` provide the Turborepo remote-cache
|
|
189
|
+
credentials.
|
|
157
190
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
short and replaceable; custom workflows and project documentation are kept.
|
|
191
|
+
Use these controls only after measuring a repeatable benefit. See [Caching and
|
|
192
|
+
remote caching](CACHING.md).
|
|
161
193
|
|
|
162
|
-
|
|
163
|
-
understand the repository without memorizing flags or environment variables.
|
|
194
|
+
## Rust CodeQL tuning
|
|
164
195
|
|
|
165
|
-
Rust CodeQL defaults to one full scan with one worker.
|
|
166
|
-
repositories can opt into bounded parallelism
|
|
196
|
+
Rust CodeQL defaults to one full scan with one worker. Larger multi-crate
|
|
197
|
+
repositories can opt into bounded parallelism:
|
|
167
198
|
|
|
168
199
|
```yaml
|
|
169
|
-
codeql_rust_shards: '["crates/api","crates/worker"]'
|
|
200
|
+
codeql_rust_shards: '["crates/api", "crates/worker"]'
|
|
170
201
|
codeql_rust_threads: 2
|
|
171
202
|
codeql_rust_max_parallel: 2
|
|
172
203
|
```
|
|
173
204
|
|
|
174
|
-
Each
|
|
175
|
-
|
|
176
|
-
shards. Do not split a single crate by arbitrary non-Rust directories: use
|
|
205
|
+
Each shard must contain tracked Rust source. Absolute paths, parent traversal,
|
|
206
|
+
duplicates, empty scopes, and more than eight shards are rejected. Use
|
|
177
207
|
`["all"]` when complete, non-overlapping source scopes are not available.
|
|
178
208
|
|
|
179
|
-
## Cloudflare Workers
|
|
209
|
+
## Cloudflare Workers
|
|
180
210
|
|
|
181
|
-
Repositories that deploy to Cloudflare Workers can
|
|
182
|
-
|
|
183
|
-
verification, and version-identity promotion
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
`Production` environment. The workflow requires the
|
|
188
|
-
`CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` secrets in the consumer
|
|
189
|
-
repository. See [Verified Cloudflare delivery](./cloudflare-delivery.md) for
|
|
190
|
-
binding policy, canary, rollback, and evidence requirements.
|
|
211
|
+
Repositories that deploy to Cloudflare Workers can use the opt-in verified
|
|
212
|
+
delivery workflow with fixed `Preview` and `Production` environments,
|
|
213
|
+
candidate verification, and version-identity promotion. Pin both the reusable
|
|
214
|
+
workflow reference and `runtime-ref` to the same reviewed 40-character commit
|
|
215
|
+
SHA. Provide `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` in the consumer
|
|
216
|
+
repository and configure environment reviewers separately.
|
|
191
217
|
|
|
192
218
|
The legacy `cloudflare-deploy.yml` workflow remains available for direct
|
|
193
219
|
(unverified) deployments. It runs `wrangler versions upload` for previews and
|
|
194
220
|
`wrangler deploy` for production, records a GitHub deployment plus status, and
|
|
195
|
-
respects `CI_BILLING_PAUSED`.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
221
|
+
respects `CI_BILLING_PAUSED`. Preview deployment records use the pull request
|
|
222
|
+
head SHA when called from a PR, which lets GitHub show the completed preview in
|
|
223
|
+
the PR's Deployments section; direct pushes use the workflow SHA. Its
|
|
224
|
+
legacy-compatible Wrangler default is `latest`; callers should prefer `local` or
|
|
225
|
+
provide an exact `wrangler-version` for reproducibility. Bun consumers may pass
|
|
226
|
+
`build-script`, `install-working-directory`, and `bun-version`; the runtime
|
|
227
|
+
installs the frozen lockfile and builds the Worker before invoking Wrangler.
|
|
228
|
+
Bun-backed callers invoke Wrangler through `bunx` so OpenNext's production
|
|
229
|
+
delegation resolves the workspace-local `opennextjs-cloudflare` binary; callers
|
|
230
|
+
without `build-script` retain the npm/npx path. See [Verified Cloudflare
|
|
231
|
+
delivery](cloudflare-delivery.md).
|
package/docs/EXTENSIONS.md
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
# Code Foundry extension points
|
|
2
2
|
|
|
3
|
-
Code Foundry uses an overlay model
|
|
3
|
+
Code Foundry uses an overlay model: `sync` refreshes the documented baseline while
|
|
4
|
+
repository-owned behavior stays in separate files.
|
|
4
5
|
|
|
5
6
|
## Managed files
|
|
6
7
|
|
|
7
|
-
The standard workflows, hooks, governance documents, language configuration, and
|
|
8
|
+
The standard workflows, hooks, governance documents, language configuration, and
|
|
9
|
+
release configuration are refreshed from the configured runtime. Keep
|
|
10
|
+
repository-specific behavior outside those managed paths.
|
|
8
11
|
|
|
9
12
|
## Custom workflows
|
|
10
13
|
|
|
11
|
-
Any workflow not named by the baseline is preserved automatically. This is the
|
|
14
|
+
Any workflow not named by the baseline is preserved automatically. This is the
|
|
15
|
+
supported place for project-specific workflows such as Slither, search indexing,
|
|
16
|
+
deployment, Docker publishing, or Vercel tasks.
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
`custom_workflows: preserve` is the default and the only supported value. Code
|
|
19
|
+
Foundry intentionally has no prune mode for custom workflows; remove those files
|
|
20
|
+
explicitly when they are no longer needed.
|
|
14
21
|
|
|
15
|
-
##
|
|
22
|
+
## Post-release delivery
|
|
16
23
|
|
|
17
|
-
Use `post_release`, `post_release_workflow`, and `post_release_mode` for a
|
|
24
|
+
Use `post_release`, `post_release_workflow`, and `post_release_mode` for a
|
|
25
|
+
post-release artifact workflow:
|
|
18
26
|
|
|
19
|
-
|
|
27
|
+
```yaml
|
|
28
|
+
post_release: true
|
|
29
|
+
post_release_workflow: deploy.yml
|
|
30
|
+
post_release_mode: auto
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`auto` uses a single workflow dispatch when `CODE_FOUNDRY_TOKEN` is available;
|
|
34
|
+
otherwise it uses the published-release event when that path is enabled. The
|
|
35
|
+
workflow receives `release-tag` and a deterministic `delivery-key`. Delivery is
|
|
36
|
+
at most once per tag, so retries must be explicit and idempotent.
|
|
37
|
+
|
|
38
|
+
Keep deployment credentials, environment files, and project-specific secrets in
|
|
39
|
+
repository or organization configuration. Code Foundry never copies secret
|
|
40
|
+
values or overwrites custom workflows in overlay mode.
|
package/docs/INITIALIZATION.md
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
# Initialization and synchronization
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Initialize, synchronize, and diagnose
|
|
4
4
|
|
|
5
5
|
Run these commands from a repository root:
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```sh
|
|
8
8
|
npx code-foundry init
|
|
9
|
+
# review or edit .github/code-foundry.yml
|
|
9
10
|
npx code-foundry sync
|
|
10
|
-
npx code-foundry doctor
|
|
11
|
+
npx code-foundry doctor # optional local/GitHub prerequisite check
|
|
11
12
|
```
|
|
12
13
|
|
|
13
|
-
`init` detects supported languages, package manager, repository profile,
|
|
14
|
-
|
|
14
|
+
`init` detects supported languages, package manager, repository profile, release
|
|
15
|
+
strategy, toolchain preference, and standard features. It writes the resolved
|
|
15
16
|
choices to `.github/code-foundry.yml`, initializes the local environment, and
|
|
16
17
|
renders the standard baseline.
|
|
17
18
|
|
|
18
|
-
After reviewing or editing the configuration, run `sync` to apply it.
|
|
19
|
-
|
|
19
|
+
After reviewing or editing the configuration, run `sync` to apply it. Run sync
|
|
20
|
+
again whenever `runtime_ref` changes or a newer reviewed runtime should be
|
|
21
|
+
adopted. `doctor` is an optional diagnostic pass; use `npx code-foundry doctor
|
|
22
|
+
--github` when authenticated GitHub prerequisite checks are also needed.
|
|
20
23
|
|
|
21
24
|
## Detection
|
|
22
25
|
|
|
@@ -25,8 +28,9 @@ manifests, lockfiles, source extensions, workspace metadata, and existing
|
|
|
25
28
|
project scripts. The generated values are explicit, so later syncs are stable
|
|
26
29
|
until a maintainer changes the file.
|
|
27
30
|
|
|
28
|
-
New repositories receive
|
|
29
|
-
`LICENSE` keep that license unless the generated configuration is
|
|
31
|
+
New repositories receive GPL-3.0-or-later. Existing repositories with an
|
|
32
|
+
authored `LICENSE` keep that license unless the generated configuration is
|
|
33
|
+
changed.
|
|
30
34
|
|
|
31
35
|
## Runtime selection
|
|
32
36
|
|