@@ -232,12 +232,75 @@ jobs:
232232 echo "| Has HTTP server code | ${{ steps.groove.outputs.has_server }} |" >> "$GITHUB_STEP_SUMMARY"
233233
234234 # ---------------------------------------------------------------------------
235- # Job 5: Dogfooding summary
235+ # Job 5: eclexiaiser manifest validation
236+ # ---------------------------------------------------------------------------
237+ eclexiaiser-validate :
238+ name : Validate eclexiaiser manifest
239+ runs-on : ubuntu-latest
240+
241+ steps :
242+ - name : Checkout repository
243+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
244+
245+ - name : Check and validate eclexiaiser manifest
246+ id : eclex
247+ run : |
248+ if [ ! -f "eclexiaiser.toml" ]; then
249+ # Check if repo has a Containerfile — if so, recommend eclexiaiser
250+ if [ -f "Containerfile" ]; then
251+ echo "::warning::Containerfile present but no eclexiaiser.toml. Run \`eclexiaiser init\` to scaffold energy/carbon budgets."
252+ fi
253+ echo "has_manifest=false" >> "$GITHUB_OUTPUT"
254+ exit 0
255+ fi
256+
257+ echo "has_manifest=true" >> "$GITHUB_OUTPUT"
258+
259+ # Validate TOML structure using Python 3.11+ tomllib
260+ python3 -c "
261+ import tomllib, sys
262+ with open('eclexiaiser.toml', 'rb') as f :
263+ data = tomllib.load(f)
264+ project = data.get('project', {})
265+ if not project.get('name', '').strip() :
266+ print('ERROR : project.name is required', file=sys.stderr)
267+ sys.exit(1)
268+ functions = data.get('functions', [])
269+ if not functions :
270+ print('ERROR : at least one [[functions]] entry is required', file=sys.stderr)
271+ sys.exit(1)
272+ for fn in functions :
273+ if not fn.get('name', '').strip() :
274+ print('ERROR : function name cannot be empty', file=sys.stderr)
275+ sys.exit(1)
276+ if not fn.get('source', '').strip() :
277+ print(f'ERROR : function {fn[\"name\"]} has no source path', file=sys.stderr)
278+ sys.exit(1)
279+ print(f'Valid : {project[\"name\"]} ({len(functions)} function(s))')
280+ " || {
281+ echo " ::error file=eclexiaiser.toml::Invalid eclexiaiser.toml — see step output for details"
282+ exit 1
283+ }
284+
285+ - name : Write summary
286+ run : |
287+ if [ "${{ steps.eclex.outputs.has_manifest }}" = "true" ]; then
288+ echo "## Eclexiaiser Manifest" >> "$GITHUB_STEP_SUMMARY"
289+ echo "" >> "$GITHUB_STEP_SUMMARY"
290+ echo ":white_check_mark: **eclexiaiser.toml** present and valid." >> "$GITHUB_STEP_SUMMARY"
291+ else
292+ echo "## Eclexiaiser Manifest" >> "$GITHUB_STEP_SUMMARY"
293+ echo "" >> "$GITHUB_STEP_SUMMARY"
294+ echo ":ballot_box_with_check: No eclexiaiser.toml. Add one with \`eclexiaiser init\` for energy/carbon tracking." >> "$GITHUB_STEP_SUMMARY"
295+ fi
296+
297+ # ---------------------------------------------------------------------------
298+ # Job 6: Dogfooding summary
236299 # ---------------------------------------------------------------------------
237300 dogfood-summary :
238301 name : Dogfooding compliance summary
239302 runs-on : ubuntu-latest
240- needs : [a2ml-validate, k9-validate, empty-lint, groove-check]
303+ needs : [a2ml-validate, k9-validate, empty-lint, groove-check, eclexiaiser-validate ]
241304 if : always()
242305
243306 steps :
@@ -247,7 +310,7 @@ jobs:
247310 - name : Generate dogfooding scorecard
248311 run : |
249312 SCORE=0
250- MAX=5
313+ MAX=6
251314
252315 # A2ML manifest present?
253316 if find . -name '*.a2ml' -not -path './.git/*' | head -1 | grep -q .; then
@@ -289,6 +352,14 @@ jobs:
289352 VSDB_STATUS=":ballot_box_with_check:"
290353 fi
291354
355+ # eclexiaiser energy tracking?
356+ if [ -f "eclexiaiser.toml" ]; then
357+ SCORE=$((SCORE + 1))
358+ ECLEX_STATUS=":white_check_mark:"
359+ else
360+ ECLEX_STATUS=":ballot_box_with_check:"
361+ fi
362+
292363 cat <<EOF >> "$GITHUB_STEP_SUMMARY"
293364 ## Dogfooding Scorecard
294365
@@ -301,6 +372,7 @@ jobs:
301372 | .editorconfig | ${EC_STATUS} | Required for all repos |
302373 | Groove endpoint | ${GROOVE_STATUS} | Required for service repos |
303374 | VeriSimDB integration | ${VSDB_STATUS} | Required for stateful repos |
375+ | eclexiaiser | ${ECLEX_STATUS} | Energy/carbon budgets for container services |
304376
305377 ---
306378 *Generated by the [Dogfood Gate](https://github.com/hyperpolymath/rsr-template-repo) workflow.*
0 commit comments