code-foundry 1.9.1 → 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.
@@ -1,5 +1,7 @@
1
1
  # Contributing
2
2
 
3
+ <!-- code-foundry-managed: config-aware-policy -->
4
+
3
5
  This guide is the operating contract for humans and automation contributing to this repository.
4
6
 
5
7
  It applies to TypeScript, Rust, Python, and mixed-language projects using this template.
@@ -1,5 +1,7 @@
1
1
  # Security Policy
2
2
 
3
+ <!-- code-foundry-managed: config-aware-policy -->
4
+
3
5
  ## Supported Versions
4
6
 
5
7
  The latest commit on `staging` receives security patches. Patches are promoted to `main` through the next release cycle.
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,12 @@
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
+
3
10
  ## [1.9.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.9.0...v1.9.1) (2026-09-08)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "1.9.1",
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": {
@@ -65,6 +65,12 @@ const protectedFiles = new Set([
65
65
  'NOTICE',
66
66
  ])
67
67
 
68
+ const configAwarePolicyFiles = new Set([
69
+ 'AGENTS.md',
70
+ '.github/CONTRIBUTING.md',
71
+ '.github/SECURITY.md',
72
+ ])
73
+
68
74
  /** @type {Record<string, string>} */
69
75
  const licenseFiles = {
70
76
  'gpl-3.0-or-later': 'GPL-3.0-or-later.txt',
@@ -206,7 +212,7 @@ export function syncRepository(options) {
206
212
  const destination = join(target, file)
207
213
  if (!force && protectedFiles.has(file) && existsSync(destination)) {
208
214
  const existing = readFileSync(destination, 'utf8')
209
- if (!isLegacyManagedDoc(file, existing)) continue
215
+ if (!isLegacyManagedDoc(file, existing) && !isManagedConfigPolicy(file, existing)) continue
210
216
  }
211
217
  if (
212
218
  (file === 'LICENSE' || file === 'NOTICE') &&
@@ -458,7 +464,7 @@ function shouldInclude(file, languages, features, config) {
458
464
  if (workflow === 'release-pr' && !isStagingRelease(config.git_workflow)) return false
459
465
  // The tiered validation caller supersedes the legacy ci/test/security/codeql
460
466
  // event callers, so legacy feature names keep selecting it.
461
- if (workflow === 'validation') {
467
+ if (workflow === 'validation' || workflow === 'validation-audit') {
462
468
  return (
463
469
  includesValue(features, 'validation') ||
464
470
  LEGACY_GENERATED_CALLERS.some((legacy) => includesValue(features, legacy))
@@ -786,7 +792,10 @@ export function isGeneratedEventCaller(content, stem, runtimeRepository) {
786
792
  const text = Buffer.isBuffer(content) ? content.toString('utf8') : String(content)
787
793
  if (!/^name:\s*Code Foundry\s*$/m.test(text)) return false
788
794
  if (/^\s*(runs-on|steps):/m.test(text)) return false
789
- if (!text.includes('runtime-repository:')) return false
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
790
799
  if (!new RegExp(`^ ${stem}:`, 'm').test(text)) return false
791
800
  return new RegExp(
792
801
  `uses:\\s*${escapeRegExp(runtimeRepository)}/\\.github/workflows/${stem}\\.yml@`
@@ -1052,6 +1061,44 @@ function isLegacyManagedDoc(file, content) {
1052
1061
  return false
1053
1062
  }
1054
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
+
1055
1102
  /** @param {string} target @param {string[]} args */
1056
1103
  function git(target, args) {
1057
1104
  spawnSync('git', args, { cwd: target, stdio: 'ignore' })