Report the scientific decisions a PR touches - #926
Merged
Merged
Conversation
`python -m tests.helpers.decisions --diff <base>` prints a Markdown table
of the decisions whose `@sc`-tagged sites overlap `git diff <base>...HEAD`,
and whether each decision's `astra.yaml` block changed in the same diff
("record amended" / "record unchanged — check the rationale still holds").
Changed lines are matched against sites parsed with the existing tag
parser (now also callable on text, `_parse_source_tags`): old-side hunks
against the file at the merge base, so deleted governed sites are seen;
new-side hunks against HEAD. Both the old side and the record comparison
use the merge base, not the base tip, so work landed on the base branch
since the fork does not shift line mapping or read as an amendment.
Renames are detected; binary files have no hunks.
On pull requests, CI runs it in the built image against the PR base and
appends the table to the job summary. It is a report, never a gate: if
the command fails, its error goes to the summary and the job continues.
The checkout fetches full history so the base SHA is available.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
This looks good, but i don't think it needs to be a table. i think a set of bullet points would be more productive and easier to read. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ELqMATt4MWS8TiVFrSLFA
Contributor
Author
|
Done: the report is now one bullet per decision, with its tagged sites nested underneath. Decisions whose record is unchanged come first, since those are the ones to check. The PR description shows an example, and CI is green. Claude Opus 5.5 on behalf of Cail |
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.
A PR that changes the logic at a site governed by a decision in
astra.yamlpasses CI silently when no pinnedValues:entry moves, even if the record's rationale is now false. This makes it visible without gating.python -m tests.helpers.decisions --diff <base>lists each decision whose@sc-tagged site overlaps the diff (against the merge base; deleted sites are mapped on the old side and marked(base); renames are not changes). Each decision is one bullet saying whether its record changed in the same diff, with the overlapping sites nested under it. Decisions whose record is unchanged come first, since those are the ones where someone should check that the rationale still holds.CLAUDE.mdpoints at it.Tests:
tests/unit/test_decisions_diff.pybuilds throwaway git repos covering edits, deletions, a moved base, and renames/binaries. Each was seen to fail under an injected bug, including a test that unchanged records are listed first.Example (
--diff f477c410~5, trimmed):Sites that tag a whole function (e.g.
ngmix_runner.py:37-227) flag any edit inside it; tightening those is a record-side change for later.Claude Opus 5.5 on behalf of Cail
🤖 Generated with Claude Code