Repository navigation
Flag bridge2ai-redcap docs/stimulus-asset drift in the redcap2rs auto-PR - #332
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The task registry pins image
stimulus_assetURLs 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-redcapdocs/— task instructions/descriptions, protocols, and the stimulus cards — are invisible to thepipeline_triggerauto-PR (e.g. #331).This adds
scripts/flag_stimulus_asset_changes.pyand runs it as a step inpipeline_trigger.yml. Per release it flags, never changes: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
eipm/bridge2ai-redcapviagithub.token. If that repo is private, the step needs a token/app with read access to it.67e75fa→main: image-clean, but correctly flagged the changed Respiration-and-cough v2 task-description markdown (EN+ES) and 13 otherdocs/changes.