code-foundry 0.31.8 → 0.31.9

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.31.9](https://github.com/0xPlayerOne/code-foundry/compare/v0.31.8...v0.31.9) (2026-07-30)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **doctor:** deduplicate required check contexts ([f244494](https://github.com/0xPlayerOne/code-foundry/commit/f24449448f177c99978fe216b92385909f275d89))
9
+
3
10
  ## [0.31.8](https://github.com/0xPlayerOne/code-foundry/compare/v0.31.7...v0.31.8) (2026-07-30)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.31.8",
3
+ "version": "0.31.9",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",
@@ -18,10 +18,7 @@ export function doctorGithub(root) {
18
18
  const protection = ghJson(['api', `repos/${repository}/branches/main/protection`])
19
19
  if (!protection) warnings.push('main branch protection is not readable or is not configured.')
20
20
  else {
21
- const required = [
22
- ...(protection.required_status_checks?.contexts ?? []),
23
- ...(protection.required_status_checks?.checks ?? []).map(/** @param {any} check */ (check) => check.context),
24
- ].filter(Boolean)
21
+ const required = requiredContexts(protection)
25
22
  details.requiredChecks = required
26
23
  const duplicateNames = required.filter((name) => /\b([^/]+) \/ \1\b/i.test(name))
27
24
  if (duplicateNames.length) errors.push(`required checks contain duplicate workflow prefixes: ${duplicateNames.join(', ')}`)
@@ -34,10 +31,7 @@ export function doctorGithub(root) {
34
31
  details.observedChecks = observed
35
32
  if (!observed.length) warnings.push('no check runs were observed on the current main commit; exact check validation is deferred until CI runs.')
36
33
  if (protection?.required_status_checks) {
37
- const required = [
38
- ...(protection.required_status_checks.contexts ?? []),
39
- ...(protection.required_status_checks.checks ?? []).map(/** @param {any} check */ (check) => check.context),
40
- ].filter(Boolean)
34
+ const required = requiredContexts(protection)
41
35
  const missing = required.filter((name) => observed.length && !observed.includes(name))
42
36
  if (missing.length) warnings.push(`required checks not observed on current main: ${missing.join(', ')}`)
43
37
  }
@@ -75,6 +69,14 @@ export function doctorGithub(root) {
75
69
  return { errors, warnings, details }
76
70
  }
77
71
 
72
+ /** @param {any} protection @returns {string[]} */
73
+ function requiredContexts(protection) {
74
+ return [...new Set([
75
+ ...(protection.required_status_checks?.contexts ?? []),
76
+ ...(protection.required_status_checks?.checks ?? []).map(/** @param {any} check */ (check) => check.context),
77
+ ].filter(Boolean))]
78
+ }
79
+
78
80
  /** @param {string} root @returns {{ errors: string[], warnings: string[] }} */
79
81
  function inspectWorkflows(root) {
80
82
  /** @type {string[]} */