From 47da9f1f82fb464ff7b93d244cd7be9c26696385 Mon Sep 17 00:00:00 2001 From: kathleen Date: Tue, 17 Nov 2026 23:48:47 +0000 Subject: [PATCH 1/2] Code the sheet's new answers; a failed build opens an issue instead of crashing the rebuild The evening source check stopped (correctly) on two answers the coding rules did not know: - first sighting "2 Greens": a new form option. Coded as Green, with a data flag that keeps the original answer (first_sighting_alias in core/spec/form.yaml). - row label "Unknown" on a bulk-pasted row: added to the entry values in data/dictionary.yaml. Workflow: when `collection update` reports the build failed, skip the rebuild (it would only fail again) and always open the "Source check failed" issue, so new answers are reported, not lost. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ --- .gitea/workflows/update-sources.yml | 5 +++-- core/atlas/coding.py | 4 ++++ core/spec/form.yaml | 5 +++++ data/dictionary.yaml | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/update-sources.yml b/.gitea/workflows/update-sources.yml index c2bc410..af3129f 100644 --- a/.gitea/workflows/update-sources.yml +++ b/.gitea/workflows/update-sources.yml @@ -48,7 +48,8 @@ jobs: REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} run: python -m collection update --report "$RUNNER_TEMP/report.md" - name: Rebuild the analysis and run tests - if: steps.check.outputs.changed == 'true' + # not when the combined runs failed validation: the issue below reports the new answers instead + if: steps.check.outputs.changed == 'true' && !contains(steps.check.outputs.failed, 'build') run: | python -m collection rebuild npm test @@ -83,7 +84,7 @@ jobs: git push origin "$branch" python -m collection forge open-pr --head "$branch" --title "New data from the community sources" --body-file "$RUNNER_TEMP/report.md" --automerge - name: Report a broken source or new answers - if: steps.check.outputs.failed != '' + if: always() && steps.check.outputs.failed != '' env: ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }} run: | diff --git a/core/atlas/coding.py b/core/atlas/coding.py index 69f658c..394701f 100644 --- a/core/atlas/coding.py +++ b/core/atlas/coding.py @@ -150,6 +150,10 @@ def code_row(r, C): company = company_raw[: -len(suffix)] if left_squad else company_raw if not left_squad and company in ("1 Squadmate", "2 Squadmates") and not (date and date >= F["left_squadmates_asked_from"]): left_squad = None # the form did not offer "left them" yet: unknown, not "stayed together" + alias = F.get("first_sighting_alias") or {} + if first in alias: + flags.append(f"first sighting answered as {first!r}") + first = alias[first] pools = F["sighting_pool"] pool = list(pools.get(company, {}).get(direction, [])) + (list(pools["Alone"].get(direction, [])) if left_squad else []) if first and first != "Unsure" and pool and first not in pool: diff --git a/core/spec/form.yaml b/core/spec/form.yaml index 94c7411..dced423 100644 --- a/core/spec/form.yaml +++ b/core/spec/form.yaml @@ -153,5 +153,10 @@ sighting_pool: 1 Squadmate: { East: [Green, Orange, Red], West: [Red, Brown, Green], Center: [Red, Brown] } 2 Squadmates: { East: [Red, Orange], West: [Green, Brown, Red], Center: [Red, Brown] } +# First-sighting answers that are not a single colour: coded as this colour, and the row is flagged with the +# original answer (data_flags), so nothing is lost. +first_sighting_alias: + "2 Greens": Green + # How a bulk-pasted row's attempt answer is read attempt_words: { first: 1, second: 2, third: 3, fourth: 4, fifth: 5 } diff --git a/data/dictionary.yaml b/data/dictionary.yaml index afb00ed..146e128 100644 --- a/data/dictionary.yaml +++ b/data/dictionary.yaml @@ -81,7 +81,7 @@ columns: For spreadsheet runs, the sheet's own row label: "Form" for a form submission (it has a timestamp); bulk-pasted logs keep the label they were pasted with. Bulk logs record every run of the players who kept them, so they are the least selectively reported rows. Empty for other sources. - values: [Form, Data Import, BulkUpload3, Manual Upload, Historical import, Unknown import] + values: [Form, Data Import, BulkUpload3, Manual Upload, Historical import, Unknown import, Unknown] bot_mode: type: text description: >- -- 2.54.0 From 6fae8a983390da7409380be3b893291562d20d0a Mon Sep 17 00:00:00 2001 From: kathleen Date: Tue, 17 Nov 2026 23:48:54 +0000 Subject: [PATCH 2/2] Daily update: no data pull request when the combined runs failed validation Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ --- .gitea/workflows/update-sources.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/update-sources.yml b/.gitea/workflows/update-sources.yml index af3129f..d11b00c 100644 --- a/.gitea/workflows/update-sources.yml +++ b/.gitea/workflows/update-sources.yml @@ -70,7 +70,7 @@ jobs: path: ${{ runner.temp }}/raw-archive key: raw-archive-${{ hashFiles('data/manifest.json') }} - name: Open a pull request with the new data (it merges itself once CI passes) - if: steps.check.outputs.changed == 'true' + if: steps.check.outputs.changed == 'true' && !contains(steps.check.outputs.failed, 'build') env: ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }} run: | -- 2.54.0