Skip to content

Commit b54da23

Browse files
committed
ci: fix review findings - heredoc, state validation, lazy import wording
Fix heredoc with indented EOF terminator that never terminates - replace with printf. Run state validation on all outcomes (not just success) so corrupted state from a failed audit is caught before caching. Only stamp last_run when audit succeeds. Align test-health lazy import section with its own Constraints (report count only, don't duplicate structure audit). Also fixes datetime.utcnow() deprecation and shell variable injection in Python string by using os.environ instead.
1 parent 9ceca2e commit b54da23

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

.agents/recipes/test-health/recipe.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ grep -rn "^import pandas\|^from pandas\|^import numpy\|^from numpy\|^import duck
107107
packages/*/src/ --include='*.py'
108108
```
109109

110-
These should use `data_designer.lazy_heavy_imports`. Cross-reference with
111-
the structure recipe's findings if available in runner memory, but don't
112-
skip this check - it directly affects user experience.
110+
These should use `data_designer.lazy_heavy_imports`. Report the count of
111+
violations found, then refer to Wednesday's structure audit for the full
112+
breakdown. Do not duplicate the detailed analysis here.
113113

114114
### 4. Executable smoke checks
115115

.github/workflows/agentic-ci-daily.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,8 @@ jobs:
103103
run: |
104104
mkdir -p .agentic-ci-state
105105
if [ ! -f .agentic-ci-state/runner-state.json ]; then
106-
cat > .agentic-ci-state/runner-state.json <<EOF
107-
{
108-
"suite": "${SUITE}",
109-
"last_run": null,
110-
"known_issues": [],
111-
"baselines": {}
112-
}
113-
EOF
106+
printf '{"suite":"%s","last_run":null,"known_issues":[],"baselines":{}}\n' \
107+
"${SUITE}" > .agentic-ci-state/runner-state.json
114108
fi
115109
echo "Runner memory state:"
116110
cat .agentic-ci-state/runner-state.json
@@ -189,21 +183,24 @@ jobs:
189183
2>&1 | tee /tmp/claude-audit-log.txt
190184
191185
- name: Update runner memory
192-
if: steps.audit.outcome == 'success'
186+
if: always()
193187
env:
194188
SUITE: ${{ matrix.suite }}
189+
AUDIT_OUTCOME: ${{ steps.audit.outcome }}
195190
run: |
196-
# Validate the agent didn't corrupt the state file
191+
# Always validate state (cache saves regardless of outcome)
197192
python3 -c "
198-
import json, datetime, sys
193+
import json, datetime, os
199194
try:
200195
with open('.agentic-ci-state/runner-state.json') as f:
201196
state = json.load(f)
202197
except (json.JSONDecodeError, FileNotFoundError) as e:
203198
print(f'::warning::runner-state.json is invalid ({e}), resetting')
204-
state = {'suite': '${SUITE}', 'known_issues': [], 'baselines': {}}
205-
state['last_run'] = datetime.datetime.utcnow().isoformat() + 'Z'
206-
state['suite'] = '${SUITE}'
199+
state = {'suite': os.environ['SUITE'], 'known_issues': [], 'baselines': {}}
200+
# Only stamp last_run if the audit actually succeeded
201+
if os.environ.get('AUDIT_OUTCOME') == 'success':
202+
state['last_run'] = datetime.datetime.now(datetime.timezone.utc).isoformat()
203+
state['suite'] = os.environ['SUITE']
207204
with open('.agentic-ci-state/runner-state.json', 'w') as f:
208205
json.dump(state, f, indent=2)
209206
"

0 commit comments

Comments
 (0)