code-foundry 1.9.0 → 1.9.2
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 +2 -0
- package/.github/SECURITY.md +2 -0
- package/.github/workflows/validation_self-ci.yml +1 -1
- package/AGENTS.md +2 -0
- package/CHANGELOG.md +14 -0
- package/README.md +2 -2
- package/docs/WORKFLOWS.md +9 -2
- package/package.json +1 -1
- package/src/commands/sync.mjs +55 -4
- package/src/templates/workflows/validation-audit.yml +43 -0
package/.github/CONTRIBUTING.md
CHANGED
package/.github/SECURITY.md
CHANGED
|
@@ -73,7 +73,7 @@ jobs:
|
|
|
73
73
|
mode: ${{ needs.mode.outputs.mode }}
|
|
74
74
|
runtime-repository: 0xPlayerOne/code-foundry
|
|
75
75
|
# Pull requests validate the proposed runtime commit. Scheduled and
|
|
76
|
-
# manually dispatched audits
|
|
76
|
+
# manually dispatched audits use a separate default-branch-pinned caller,
|
|
77
77
|
# so this caller-selected ref never runs with default-branch cache access.
|
|
78
78
|
runtime-ref: ${{ github.sha }}
|
|
79
79
|
ci-runner: ubuntu-latest
|
package/AGENTS.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Agent Instructions
|
|
2
2
|
|
|
3
|
+
<!-- code-foundry-managed: config-aware-policy -->
|
|
4
|
+
|
|
3
5
|
These instructions are the repository-level operating contract for coding agents, including Hermes, OpenCode, and other automation.
|
|
4
6
|
|
|
5
7
|
They complement `CONTRIBUTING.md`. More specific instructions in nested `AGENTS.md` files and project documentation take precedence for their directory.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.9.2](https://github.com/0xPlayerOne/code-foundry/compare/v1.9.1...v1.9.2) (2026-09-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **sync:** refresh config-aware policies ([#505](https://github.com/0xPlayerOne/code-foundry/issues/505)) ([466150d](https://github.com/0xPlayerOne/code-foundry/commit/466150dcf263187e9cb08be2a2c2fe7ff67ef060))
|
|
9
|
+
|
|
10
|
+
## [1.9.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.9.0...v1.9.1) (2026-09-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **ci:** restore protected consumer audits ([#503](https://github.com/0xPlayerOne/code-foundry/issues/503)) ([d045cc4](https://github.com/0xPlayerOne/code-foundry/commit/d045cc4a5543d2096e4d6f33c5e74aa40604c887))
|
|
16
|
+
|
|
3
17
|
## [1.9.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.8.0...v1.9.0) (2026-09-08)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ contract. For normal updates, edit that file and run `npx code-foundry sync`.
|
|
|
35
35
|
|
|
36
36
|
## What it installs
|
|
37
37
|
|
|
38
|
-
- Short workflow callers for
|
|
39
|
-
and Release.
|
|
38
|
+
- Short workflow callers for pull-request validation, protected scheduled/manual
|
|
39
|
+
audits, Draft PR, Release PR, and Release.
|
|
40
40
|
- A deterministic performance lane with ordered command support, stable result
|
|
41
41
|
artifacts, and an optional shared Node package budget profile.
|
|
42
42
|
- A small `.githooks/pre-commit` launcher with language-aware formatting and
|
package/docs/WORKFLOWS.md
CHANGED
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Standard triggers
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Validation uses two callers so pull-request code and default-branch-capable
|
|
6
|
+
audit events never share a caller-selected runtime ref. The canonical
|
|
7
|
+
`validation.yml` caller handles pull requests only:
|
|
7
8
|
|
|
8
9
|
```yaml
|
|
9
10
|
pull_request:
|
|
10
11
|
branches: [main, staging] # staging-release topology
|
|
11
12
|
# direct topology: branches: [main]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The separate `validation-audit.yml` caller is pinned to the configured released
|
|
16
|
+
runtime and handles scheduled and manual audits:
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
12
19
|
schedule:
|
|
13
20
|
- cron: '31 6 * * 1'
|
|
14
21
|
workflow_dispatch:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-foundry",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
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": {
|
package/src/commands/sync.mjs
CHANGED
|
@@ -42,6 +42,7 @@ const standardFiles = [
|
|
|
42
42
|
'.github/ISSUE_TEMPLATE/config.yml',
|
|
43
43
|
'.github/ISSUE_TEMPLATE/feature_request.yml',
|
|
44
44
|
'.github/workflows/validation.yml',
|
|
45
|
+
'.github/workflows/validation-audit.yml',
|
|
45
46
|
'.github/workflows/draft-pr.yml',
|
|
46
47
|
'.github/workflows/release-pr.yml',
|
|
47
48
|
'.github/workflows/release.yml',
|
|
@@ -64,6 +65,12 @@ const protectedFiles = new Set([
|
|
|
64
65
|
'NOTICE',
|
|
65
66
|
])
|
|
66
67
|
|
|
68
|
+
const configAwarePolicyFiles = new Set([
|
|
69
|
+
'AGENTS.md',
|
|
70
|
+
'.github/CONTRIBUTING.md',
|
|
71
|
+
'.github/SECURITY.md',
|
|
72
|
+
])
|
|
73
|
+
|
|
67
74
|
/** @type {Record<string, string>} */
|
|
68
75
|
const licenseFiles = {
|
|
69
76
|
'gpl-3.0-or-later': 'GPL-3.0-or-later.txt',
|
|
@@ -205,7 +212,7 @@ export function syncRepository(options) {
|
|
|
205
212
|
const destination = join(target, file)
|
|
206
213
|
if (!force && protectedFiles.has(file) && existsSync(destination)) {
|
|
207
214
|
const existing = readFileSync(destination, 'utf8')
|
|
208
|
-
if (!isLegacyManagedDoc(file, existing)) continue
|
|
215
|
+
if (!isLegacyManagedDoc(file, existing) && !isManagedConfigPolicy(file, existing)) continue
|
|
209
216
|
}
|
|
210
217
|
if (
|
|
211
218
|
(file === 'LICENSE' || file === 'NOTICE') &&
|
|
@@ -457,7 +464,7 @@ function shouldInclude(file, languages, features, config) {
|
|
|
457
464
|
if (workflow === 'release-pr' && !isStagingRelease(config.git_workflow)) return false
|
|
458
465
|
// The tiered validation caller supersedes the legacy ci/test/security/codeql
|
|
459
466
|
// event callers, so legacy feature names keep selecting it.
|
|
460
|
-
if (workflow === 'validation') {
|
|
467
|
+
if (workflow === 'validation' || workflow === 'validation-audit') {
|
|
461
468
|
return (
|
|
462
469
|
includesValue(features, 'validation') ||
|
|
463
470
|
LEGACY_GENERATED_CALLERS.some((legacy) => includesValue(features, legacy))
|
|
@@ -473,6 +480,9 @@ function sourcePath(source, file) {
|
|
|
473
480
|
return existsSync(rootTemplate) ? rootTemplate : join(source, 'src/templates/gitignore')
|
|
474
481
|
}
|
|
475
482
|
if (file.startsWith('.github/workflows/')) {
|
|
483
|
+
if (file === '.github/workflows/validation-audit.yml') {
|
|
484
|
+
return join(source, 'src/templates/workflows/validation-audit.yml')
|
|
485
|
+
}
|
|
476
486
|
const name = file.slice('.github/workflows/'.length, -4)
|
|
477
487
|
return join(source, '.github/workflows', `${name}_self-ci.yml`)
|
|
478
488
|
}
|
|
@@ -535,7 +545,7 @@ function renderWorkflow(content, config, repository, ref, rustCodeql) {
|
|
|
535
545
|
if (workflow === 'test' && config.unit_runner) {
|
|
536
546
|
rendered = rendered.replace(/^(\s+unit-runner:)\s+.*$/m, `$1 ${config.unit_runner}`)
|
|
537
547
|
}
|
|
538
|
-
if (workflow === 'validation') {
|
|
548
|
+
if (workflow === 'validation' || workflow === 'validation-audit') {
|
|
539
549
|
// The mode classifier is a normal runner job in the caller rather than a
|
|
540
550
|
// reusable-workflow input. Keep it on the configured default runner so
|
|
541
551
|
// consumers that cannot use ubuntu-slim do not fail before validation.
|
|
@@ -782,7 +792,10 @@ export function isGeneratedEventCaller(content, stem, runtimeRepository) {
|
|
|
782
792
|
const text = Buffer.isBuffer(content) ? content.toString('utf8') : String(content)
|
|
783
793
|
if (!/^name:\s*Code Foundry\s*$/m.test(text)) return false
|
|
784
794
|
if (/^\s*(runs-on|steps):/m.test(text)) return false
|
|
785
|
-
|
|
795
|
+
// Older generated staging-promotion callers predate the explicit runtime
|
|
796
|
+
// repository input. They are still safe to identify structurally by their
|
|
797
|
+
// single reusable-workflow job so direct-topology syncs can remove them.
|
|
798
|
+
if (stem !== 'release-pr' && !text.includes('runtime-repository:')) return false
|
|
786
799
|
if (!new RegExp(`^ ${stem}:`, 'm').test(text)) return false
|
|
787
800
|
return new RegExp(
|
|
788
801
|
`uses:\\s*${escapeRegExp(runtimeRepository)}/\\.github/workflows/${stem}\\.yml@`
|
|
@@ -1048,6 +1061,44 @@ function isLegacyManagedDoc(file, content) {
|
|
|
1048
1061
|
return false
|
|
1049
1062
|
}
|
|
1050
1063
|
|
|
1064
|
+
/**
|
|
1065
|
+
* Config-aware policy documents are generated contracts: a normal sync must
|
|
1066
|
+
* refresh them after branch-topology or validation-policy edits. The marker
|
|
1067
|
+
* owns future copies. Exact scaffold signatures migrate older generated
|
|
1068
|
+
* copies without treating arbitrary repository documentation as managed.
|
|
1069
|
+
* @param {string} file
|
|
1070
|
+
* @param {string} content
|
|
1071
|
+
*/
|
|
1072
|
+
function isManagedConfigPolicy(file, content) {
|
|
1073
|
+
if (!configAwarePolicyFiles.has(file)) return false
|
|
1074
|
+
if (content.includes('<!-- code-foundry-managed: config-aware-policy -->')) return true
|
|
1075
|
+
if (file === 'AGENTS.md') {
|
|
1076
|
+
return (
|
|
1077
|
+
content.startsWith('# Agent Instructions\n') &&
|
|
1078
|
+
content.includes(
|
|
1079
|
+
'These instructions are the repository-level operating contract for coding agents'
|
|
1080
|
+
) &&
|
|
1081
|
+
content.includes('They complement `CONTRIBUTING.md`.')
|
|
1082
|
+
)
|
|
1083
|
+
}
|
|
1084
|
+
if (file === '.github/CONTRIBUTING.md') {
|
|
1085
|
+
return (
|
|
1086
|
+
content.startsWith('# Contributing\n') &&
|
|
1087
|
+
content.includes(
|
|
1088
|
+
'This guide is the operating contract for humans and automation contributing to this repository.'
|
|
1089
|
+
) &&
|
|
1090
|
+
content.includes('[Agent contract](#agent-operating-contract)')
|
|
1091
|
+
)
|
|
1092
|
+
}
|
|
1093
|
+
return (
|
|
1094
|
+
content.startsWith('# Security Policy\n') &&
|
|
1095
|
+
content.includes('## Reporting a Vulnerability') &&
|
|
1096
|
+
content.includes(
|
|
1097
|
+
'This policy covers the code, configuration, dependencies, workflows, and generated artifacts maintained in this repository.'
|
|
1098
|
+
)
|
|
1099
|
+
)
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1051
1102
|
/** @param {string} target @param {string[]} args */
|
|
1052
1103
|
function git(target, args) {
|
|
1053
1104
|
spawnSync('git', args, { cwd: target, stdio: 'ignore' })
|
|
@@ -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 use an immutable released runtime for both
|
|
16
|
+
# reusable workflow code and runtime code. They never accept a caller-
|
|
17
|
+
# controlled runtime ref and cannot execute pull-request code with access to
|
|
18
|
+
# the protected default-branch cache.
|
|
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: ./.github/workflows/validation.yml
|
|
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 }}
|