Skip to content

Carry the GitHub Action helper, un-ignoring its 13 tests - #33

Merged
n1ckyb merged 1 commit into
release/v0.0.2-rcfrom
sync/github-action-script
Aug 10, 2026
Merged

Carry the GitHub Action helper, un-ignoring its 13 tests#33
n1ckyb merged 1 commit into
release/v0.0.2-rcfrom
sync/github-action-script

Conversation

@n1ckyb

@n1ckyb n1ckyb commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

tests/conftest.py ignores a tooling test when its script is absent. scripts/github_action.py was never synced here, so test_github_action.py has been silently ignored — 13 tests that exist in this repo and have never run in it.

The script belongs here rather than in a sibling: it imports intentumdiff four times and drives the PR-check surface for this package.

Verification

From a bare clone: 9 pass, 4 fail with

RuntimeError: intentumdiff_rust_core compiled core not found for the C ABI

That is the clone having no built core, not a defect in the tests — the same condition that makes the whole component-dependent suite unrunnable outside CI (#22). CI provisions the core, so CI is the verification.

Two sibling scripts deliberately NOT included

pre_commit_security_gate.py and security_prereq_check.py are also absent here, also silently ignoring their tests (9 more between them).

Neither imports intentumdiff — one is a git pre-commit hook, the other checks cargo/advisory-db prerequisites. Both are generic repo hygiene, equally applicable to any repo in the estate, so "belongs in the python repo" is a judgement rather than a fact and is left to the maintainer.

Adding files to a published repo on a plan's say-so is the same move as deleting them on one.

Context

Part of closing the gap where this repo's CI collects 84 fewer tests than the monorepo — 89 never run here: 65 hidden by the conditional collect_ignore, 24 never synced. This closes 13 of the 65.

🤖 Generated with Claude Code

tests/conftest.py ignores a tooling test when its script is absent. scripts/
github_action.py was never synced here, so test_github_action.py has been
silently ignored - 13 tests that exist in this repo and have never run in it.

The script belongs here rather than in a sibling: it imports intentumdiff four
times and drives the PR-check surface for this package.

Verified from a bare clone: 9 pass, 4 fail with

    RuntimeError: intentumdiff_rust_core compiled core not found for the C ABI

which is the clone having no built core, not a defect in the tests - the same
condition that makes the whole component-dependent suite unrunnable outside CI
(#22). CI provisions the core, so it is the verification.

## Two sibling scripts deliberately NOT synced

pre_commit_security_gate.py and security_prereq_check.py are also absent here,
also silently ignoring their tests (9 more). They are NOT included because
neither imports intentumdiff - one is a git pre-commit hook, the other checks
cargo/advisory-db prerequisites. Both are generic repo hygiene, equally
applicable to any repo in the estate, so "belongs in the python repo" is a
judgement rather than a fact and is left to the maintainer.

Adding files to a published repo on a plan's say-so is the same move as deleting
them on one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8dcabee53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/github_action.py
Comment on lines +136 to +143
config = load_project_diff_config(options.repo)
if options.fuel is not None:
config.plugin_fuel = options.fuel
if options.policy:
config.guardrail_policy_path = _policy_path(options.repo, options.policy)
else:
config.guardrail_policy_path = find_intentumdiff_config(options.repo)
config.guardrails_strict = options.strict

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Load guardrail settings from the trusted base revision

When a PR changes intentumdiff.yaml to set config.guardrails_enabled: false, this loads that untrusted head configuration before evaluating the diff; apply_guardrails_to_diff() then returns immediately, so even the normally immutable policy-file edit produces no violation and a strict action exits successfully. The default PR workflow therefore permits a change to disable the protection intended to review that same change; load the guardrail policy/settings from the base revision or force guardrails enabled for this check.

Useful? React with 👍 / 👎.

Comment thread scripts/github_action.py
Comment on lines +145 to +148
commit_diff = differ_factory(config).diff_commit(
repo_path=options.repo,
old_ref=options.base_ref,
new_ref=options.head_ref,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Diff pull requests from their merge base

When the base branch has advanced since the PR branch diverged, comparing the current base SHA directly with the head SHA includes base-only changes as reverse changes in the report. That can create unrelated semantic changes or strict guardrail failures for files the PR never touched; resolve the merge base of these refs and use it as old_ref, matching the PR's three-dot change set.

Useful? React with 👍 / 👎.

Comment thread scripts/github_action.py
Comment on lines +660 to +663
for comment in comments:
body = str(comment.get("body", "")) if isinstance(comment, dict) else ""
if COMMENT_MARKER in body:
existing_id = comment.get("id")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update only comments authored by the action

If a PR participant posts a comment containing <!-- intentumdiff:summary --> before this runs, the marker-only search selects that comment and PATCHes it using the repository token, overwriting user-authored content. Verify the comment author or another action-owned identifier in addition to the marker before treating it as the sticky report.

Useful? React with 👍 / 👎.

@n1ckyb
n1ckyb merged commit 5f9391d into release/v0.0.2-rc Aug 10, 2026
1 check passed
@n1ckyb
n1ckyb deleted the sync/github-action-script branch August 10, 2026 07:40
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