Skip to content

chore(infra): harden Claude session hook + add version-vs-tag publish guard#60

Merged
amavashev merged 1 commit into
mainfrom
chore/infra-hardening-2026-05
May 12, 2026
Merged

chore(infra): harden Claude session hook + add version-vs-tag publish guard#60
amavashev merged 1 commit into
mainfrom
chore/infra-hardening-2026-05

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

Summary

Two infra-only changes responding to org-wide tracking issues filed in runcycles/.github:

  • .claude/session-start-global-deny.sh synced from the new canonical at runcycles/.github/shared-config/ (tracks runcycles/.github#63)
  • .github/workflows/python-publish.yml gained a version-vs-tag guard (Python analog of runcycles/.github#61)

Both are infra-only. No SDK source changed, no protocol impact, no version bump.

Changes

.claude/session-start-global-deny.sh (sync from canonical)

The script now (a) carries a top-of-file callout explaining that Part 2 mutates the origin remote of every sibling repo under /home/user/*, not just the current checkout, and (b) honors CYCLES_CLAUDE_SKIP_REMOTE_REWRITE=1 to opt out of the multi-repo rewrite for local Claude Code runs. Part 1 (global MCP deny rules) is unchanged.

.github/workflows/python-publish.yml (new guard step)

Added Verify pyproject version matches tag between setup-python and the build. Runs only on tag-triggered builds (refs/tags/v*). Reads pyproject.toml via tomllib and fails fast if the declared version doesn't match the tag — e.g., tag v0.5.0 against pyproject.toml still on 0.4.1 or a dev0 pre-release.

PyPI already rejects duplicate versions server-side, so the actual harm without this guard is a noisy late-stage failure rather than a wrong publish. The guard surfaces the operator error before the build/upload phase.

AUDIT.md

Appended Infrastructure Hardening (added 2026-05-12) section. Explicit "Protocol conformance: unchanged" — these are CI/Claude-config changes, no SDK source touched, test suite unaffected.

Not in this PR (follow-up)

The third related issue is runcycles/.github#60 — bumping the reusable-workflow ref:

uses: runcycles/.github/.github/workflows/ci-python.yml@main  # → @v1

That bump is blocked on the v1 tag being cut in runcycles/.github, which is in turn blocked on runcycles/.github#64 merging (the canonical-script PR). Splitting it out keeps this PR safe to merge anytime without breaking CI.

Test plan

  • python -m yaml.safe_load parses python-publish.yml
  • bash -n on .claude/session-start-global-deny.sh
  • Manual smoke: tag a test wheel with mismatched pyproject.toml version and verify the workflow fails at the verify step, not at the upload step
  • Manual smoke: run a Claude Code session with CYCLES_CLAUDE_SKIP_REMOTE_REWRITE=1 set and confirm sibling repo origin URLs are untouched

… guard

Two infra-only changes responding to org-wide tracking issues filed in
runcycles/.github.

.claude/session-start-global-deny.sh
  Synced from the new canonical at runcycles/.github/shared-config/. The
  script now carries a top-of-file callout explaining that Part 2 mutates
  every sibling repo under /home/user/*, and honors a new env var
  CYCLES_CLAUDE_SKIP_REMOTE_REWRITE=1 to opt out of the multi-repo
  rewrite. Part 1 (global MCP deny rules) is unchanged. Tracks
  runcycles/.github#63.

.github/workflows/python-publish.yml
  Added a "Verify pyproject version matches tag" step that runs on
  tag-triggered builds. Uses tomllib to read pyproject.toml's
  project.version and fails fast if it doesn't match the tag (e.g.
  v0.5.0 against pyproject.toml still on 0.4.1 or a dev0 pre-release).
  PyPI rejects duplicate versions server-side anyway, but this surfaces
  the operator error before the build/upload phase. Python analog of
  the Java SNAPSHOT-guard tracked in runcycles/.github#61.

AUDIT.md
  Appended "Infrastructure Hardening (added 2026-05-12)" section noting
  both changes are infra-only with no protocol or wire-format impact.

Not in this PR: bumping the reusable-workflow ref ci.yml@main → @v1 for
runcycles/.github#60. That follow-up is blocked on the v1 tag being cut
in runcycles/.github after PR #64 there merges.
@amavashev amavashev merged commit 0c18750 into main May 12, 2026
7 checks passed
@amavashev amavashev deleted the chore/infra-hardening-2026-05 branch May 12, 2026 15:59
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