code-foundry 0.39.4 → 0.40.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/CHANGELOG.md +7 -0
- package/docs/CONFIGURATION.md +1 -0
- package/package.json +1 -1
- package/src/commands/sync.mjs +14 -2
- package/src/lib/validation-policy.mjs +11 -4
- package/src/runtime.mjs +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.40.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.39.4...v0.40.0) (2026-08-31)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **validation:** allow audit mode on staging PRs ([0d95123](https://github.com/0xPlayerOne/code-foundry/commit/0d951230b9095d3b875db44ae8287335152eee60))
|
|
9
|
+
|
|
3
10
|
## [0.39.4](https://github.com/0xPlayerOne/code-foundry/compare/v0.39.3...v0.39.4) (2026-08-29)
|
|
4
11
|
|
|
5
12
|
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -35,6 +35,7 @@ repository manifests and source
|
|
|
35
35
|
| `languages` | detected list | TypeScript, Rust, Python, Solidity |
|
|
36
36
|
| `package_manager` | `bun`, `pnpm`, `yarn`, `npm`, `none` | JavaScript setup |
|
|
37
37
|
| `toolchain` | `auto`, `native`, `mise` | Environment setup policy; defaults to `auto` |
|
|
38
|
+
| `staging_validation_mode` | `fast`, `audit` | Validation tier for pull requests targeting `staging`; defaults to `fast` |
|
|
38
39
|
| `features` | `all` or a list | Standard workflow callers |
|
|
39
40
|
| `codeql` | `auto`, `true`, `false` | CodeQL policy; public repositories default to enabled, non-public repositories default to disabled |
|
|
40
41
|
| `codeql_rust_shards` | JSON array of paths | Rust scan scopes; `["all"]` keeps the safe single full scan |
|
package/package.json
CHANGED
package/src/commands/sync.mjs
CHANGED
|
@@ -100,6 +100,12 @@ export function syncRepository(options) {
|
|
|
100
100
|
if (!['direct', 'staging-release'].includes(workflow)) {
|
|
101
101
|
throw new Error(`Unsupported git_workflow: ${workflow}; use direct or staging-release.`)
|
|
102
102
|
}
|
|
103
|
+
const stagingValidationMode = configured(config.staging_validation_mode, 'fast')
|
|
104
|
+
if (!['fast', 'audit'].includes(stagingValidationMode)) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Unsupported staging_validation_mode: ${stagingValidationMode}; use fast or audit.`
|
|
107
|
+
)
|
|
108
|
+
}
|
|
103
109
|
const mergeStrategy = configured(config.merge_strategy, 'rebase')
|
|
104
110
|
if (workflow === 'staging-release' && mergeStrategy !== 'rebase') {
|
|
105
111
|
throw new Error(`Unsupported merge_strategy: ${mergeStrategy}; the staging-release topology requires rebase for staging to main promotions.`)
|
|
@@ -429,7 +435,13 @@ function renderDependabot(content, config, languages) {
|
|
|
429
435
|
* @returns {string}
|
|
430
436
|
*/
|
|
431
437
|
export function renderContributionDocs(content, file, config) {
|
|
432
|
-
if (isStagingRelease(config.git_workflow))
|
|
438
|
+
if (isStagingRelease(config.git_workflow)) {
|
|
439
|
+
if (configured(config.staging_validation_mode, 'fast') !== 'audit') return content
|
|
440
|
+
return content.replace(
|
|
441
|
+
'Fast validation: CI plus unit tests, ending in `Validation / Gate`',
|
|
442
|
+
'Audit validation: CI, full tests, Security, and CodeQL, ending in `Validation / Gate`'
|
|
443
|
+
)
|
|
444
|
+
}
|
|
433
445
|
const replacements = DIRECT_DOC_REPLACEMENTS[file]
|
|
434
446
|
if (!replacements) return content
|
|
435
447
|
let rendered = content
|
|
@@ -645,7 +657,7 @@ function createDefaultConfig(root, source) {
|
|
|
645
657
|
codeql_rust_shards: '["all"]', codeql_rust_threads: '1', codeql_rust_max_parallel: '1',
|
|
646
658
|
runtime_repository: '0xPlayerOne/code-foundry', runtime_ref: `v${readPackageVersion(source)}`,
|
|
647
659
|
...runners,
|
|
648
|
-
toolchain: 'auto',
|
|
660
|
+
toolchain: 'auto', staging_validation_mode: 'fast',
|
|
649
661
|
prune_standard: 'false', cache_packages: 'auto', cache_build: 'auto', coverage_minimum: '80', turbo_remote: 'auto',
|
|
650
662
|
release_type: detectPackageManager(root) === 'none' ? 'auto' : 'node', npm_publish: 'false',
|
|
651
663
|
post_release: 'false', post_release_workflow: '', post_release_mode: 'auto',
|
|
@@ -40,18 +40,18 @@ export function isReleasePleaseHead(headRef) {
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Classify an event into exactly one validation mode, failing closed:
|
|
43
|
-
* - fast: pull_request targeting staging
|
|
43
|
+
* - fast or audit: pull_request targeting staging, according to the repository policy
|
|
44
44
|
* - release: pull_request targeting main whose head is the exact approved
|
|
45
45
|
* Release Please prefix
|
|
46
46
|
* - audit: every other pull_request targeting main, plus schedule and
|
|
47
47
|
* workflow_dispatch
|
|
48
48
|
* Unsupported events (for example push) and unsupported base branches are
|
|
49
49
|
* rejected so canonical validation can never silently run or silently skip.
|
|
50
|
-
* @param {{ eventName: string, baseRef?: string, headRef?: string }} input
|
|
50
|
+
* @param {{ eventName: string, baseRef?: string, headRef?: string, stagingMode?: string }} input
|
|
51
51
|
* @returns {'fast'|'audit'|'release'}
|
|
52
52
|
*/
|
|
53
53
|
export function classifyValidationMode(input) {
|
|
54
|
-
const { eventName, baseRef, headRef } = input
|
|
54
|
+
const { eventName, baseRef, headRef, stagingMode = 'fast' } = input
|
|
55
55
|
if (typeof eventName !== 'string' || !VALIDATION_EVENTS.includes(eventName)) {
|
|
56
56
|
throw new Error(
|
|
57
57
|
`Unsupported validation event: ${eventName ?? '(missing)'}; canonical validation must not run on this event.`
|
|
@@ -64,7 +64,14 @@ export function classifyValidationMode(input) {
|
|
|
64
64
|
if (typeof headRef !== 'string' || headRef.length === 0) {
|
|
65
65
|
throw new Error('pull_request classification requires head_ref.')
|
|
66
66
|
}
|
|
67
|
-
if (baseRef === 'staging')
|
|
67
|
+
if (baseRef === 'staging') {
|
|
68
|
+
if (stagingMode !== 'fast' && stagingMode !== 'audit') {
|
|
69
|
+
throw new Error(
|
|
70
|
+
`Unsupported staging validation mode: ${stagingMode || '(missing)'}; expected fast or audit.`
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
return stagingMode
|
|
74
|
+
}
|
|
68
75
|
if (baseRef === 'main') return isReleasePleaseHead(headRef) ? 'release' : 'audit'
|
|
69
76
|
throw new Error(`Unsupported pull_request base branch: ${baseRef}; expected staging or main.`)
|
|
70
77
|
}
|
package/src/runtime.mjs
CHANGED