Skip to content

Commit ef0f852

Browse files
committed
brain: import only materialized reader comparisons
1 parent 3577381 commit ef0f852

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/native-reader-learning-sync.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
PY
8080
8181
- name: Download exact Android reader-repair comparison
82+
id: evidence
8283
if: steps.source.outputs.duplicate != 'true'
8384
env:
8485
GH_TOKEN: ${{ github.token }}
@@ -87,13 +88,17 @@ jobs:
8788
run: |
8889
set -euo pipefail
8990
mkdir -p reader-learning-input/acceptance
90-
gh run download "$RUN_ID" --name "native-reader-brain-repair-$RUN_ID" --dir reader-learning-input/acceptance || true
91-
if [ ! -s reader-learning-input/acceptance/tv-reader-repair-comparison.json ]; then
92-
printf '{"acceptedCount":0,"rejectedCount":0,"inconclusiveCount":0,"accepted":[],"rejected":[],"inconclusive":[]}\n' > reader-learning-input/acceptance/tv-reader-repair-comparison.json
91+
if gh run download "$RUN_ID" --name "native-reader-brain-repair-$RUN_ID" --dir reader-learning-input/acceptance \
92+
&& [ -s reader-learning-input/acceptance/tv-reader-repair-comparison.json ]; then
93+
echo "has_comparison=true" >> "$GITHUB_OUTPUT"
94+
else
95+
echo "has_comparison=false" >> "$GITHUB_OUTPUT"
96+
rm -rf reader-learning-input/acceptance
97+
echo "No materialized reader-repair comparison for run $RUN_ID; nothing is learned and the run remains importable after a rerun."
9398
fi
9499
95100
- name: Merge sanitized reader repair memory once
96-
if: steps.source.outputs.duplicate != 'true'
101+
if: steps.source.outputs.duplicate != 'true' && steps.evidence.outputs.has_comparison == 'true'
97102
env:
98103
RUN_ID: ${{ steps.source.outputs.run_id }}
99104
shell: bash
@@ -128,8 +133,13 @@ jobs:
128133
shell: bash
129134
run: echo "Reader run ${{ steps.source.outputs.run_id }} was already imported; no counters changed."
130135

136+
- name: Report missing reader comparison
137+
if: steps.source.outputs.duplicate != 'true' && steps.evidence.outputs.has_comparison != 'true'
138+
shell: bash
139+
run: echo "Reader run ${{ steps.source.outputs.run_id }} produced no importable repair comparison; persistent Brain state is unchanged."
140+
131141
- name: Update the single Brain memory branch
132-
if: steps.source.outputs.duplicate != 'true'
142+
if: steps.source.outputs.duplicate != 'true' && steps.evidence.outputs.has_comparison == 'true'
133143
shell: bash
134144
run: |
135145
set -euo pipefail

0 commit comments

Comments
 (0)