Skip to content

Flag bridge2ai-redcap docs/stimulus-asset drift in the redcap2rs auto-PR - #332

Merged
wilke0818 merged 2 commits into
mainfrom
feat/stimulus-asset-drift-check
Aug 28, 2026
Merged

wilke0818 merged 2 commits into
mainfrom
feat/stimulus-asset-drift-check

Conversation

@wilke0818

Copy link
Copy Markdown
Contributor

What

The task registry pins image stimulus_asset URLs to a bridge2ai-redcap commit (immutable on purpose — the URL shows the image contemporaneous with that release's data; we do not auto-bump). redcap2rs converts only the RedCap data dictionary, so changes under bridge2ai-redcap docs/ — task instructions/descriptions, protocols, and the stimulus cards — are invisible to the pipeline_trigger auto-PR (e.g. #331).

This adds scripts/flag_stimulus_asset_changes.py and runs it as a step in pipeline_trigger.yml. Per release it flags, never changes:

  • link-rot — every registry-referenced image still resolves at its pinned commit;
  • image drift (per task) — added/removed/changed-by-blob-SHA vs the new release; a change on a transcribed card (identifying-pictures words, sound tokens) is flagged as needing OCR/vision re-transcription + a new-pin decision;
  • docs drift — whole docs/ tree diff (blob SHA) between the pinned baseline and the new release, surfacing instruction/protocol/card changes redcap2rs doesn't.

The report is appended to the auto-PR body and the job summary. The step is continue-on-error, so it never blocks the redcap2rs PR — re-transcription and re-pinning stay a deliberate, human, version-scoped decision.

Notes

  • stdlib only (urllib); reads the public eipm/bridge2ai-redcap via github.token. If that repo is private, the step needs a token/app with read access to it.
  • Tested against 67e75fa → main: image-clean, but correctly flagged the changed Respiration-and-cough v2 task-description markdown (EN+ES) and 13 other docs/ changes.

wilke0818 and others added 2 commits August 28, 2026 14:06
The stimulus_asset image URLs in the task registry are pinned to a bridge2ai-redcap
commit (immutable on purpose; not auto-bumped). redcap2rs only converts the data
dictionary, so changes under bridge2ai-redcap docs/ -- task instructions/descriptions,
protocols, and the stimulus cards -- are invisible to the pipeline_trigger auto-PR.

Add scripts/flag_stimulus_asset_changes.py (stdlib + GitHub API) and run it as a step in
pipeline_trigger.yml. Per release it flags, but never changes:
- link-rot: pinned images still resolve at their commit;
- image drift: per-task added/removed/changed-by-blob-SHA vs the new release (a change on
  a transcribed card is flagged as needing OCR/vision re-transcription + a new-pin decision);
- docs drift: whole docs/ tree diff (blob SHA) between the pinned baseline and the new
  release, surfacing instruction/protocol/card changes redcap2rs doesn't.

The report is appended to the auto-PR body and the job summary; the step is
continue-on-error so it never blocks the redcap2rs PR. Re-transcription and re-pinning
stay a deliberate, human, version-scoped decision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ess, PR-body limit)

- Never silently no-op: wrap the run in try/except, always write a report, and use
  distinct exit codes (0 clean / 1 flagged / 2 check errored) so a transient API error
  is no longer indistinguishable from "no drift".
- Link-rot now checks the FULL expected image set (enumerated from asset_map / a filled
  template x count) instead of only "at least one file matches", so partial deletions of
  a multi-image task (e.g. Story Recall) are caught.
- asset_map entries are validated in each file's own directory (not just paths[0]'s).
- Placeholder regex accepts any {..} token, not just {i}/{n}.
- Baseline commit is computed once and formatted None-safely (a task with asset_repo but
  null asset_commit no longer crashes the report).
- Workflow: cap the drift report embedded in the PR body to stay under GitHub's
  65,536-char limit (full report stays in the job summary), and use `curl --fail-with-body`
  so a failed PR creation surfaces instead of silently exiting 0. Replaced the dead
  STIMULUS_DRIFT env write with a ::warning:: annotation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wilke0818
wilke0818 merged commit bb49e4e into main Aug 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant