Skip to content

chore(ci): harden CI, release, Ruff, packaging, and test isolation - #22

Merged
jtaroreh merged 1 commit into
mainfrom
chore/ci-release-hardening
Nov 22, 2026
Merged

jtaroreh merged 1 commit into
mainfrom
chore/ci-release-hardening

Conversation

@jtaroreh

Copy link
Copy Markdown
Owner

Why

CI skipped linting hooks and Python scripts outside the core error set, used unpinned actions and pip install, omitted TypeScript checks on root scripts, and let release jobs publish without running CI or verifying tag parity. Local tests also wrote artifacts into the repo root .slices/ directory and ~/.gemini/antigravity/brain.

Scope

  • Expanded [tool.ruff.lint] in pyproject.toml to select E4, E7, E9, F, W, and B, removed E722 from ignore, removed "skills/poteto-mode/scripts/*" = ["ALL"] from per-file-ignores, and fixed all 34 findings across cloud_dispatch.py, result_harvester.py, steer_cloud_task.py, storage_messenger.py, agent_hooks.py, execution.py, partner_engine.py, setup_runtime.py, and tests/test_skill_catalog.py.
  • Hardened .github/workflows/ci.yml with workflow_call, permissions: { contents: read }, branch-aware concurrency, timeout-minutes: 15, 40-char commit SHA pins for all actions, uv sync --frozen --extra test, bun-version: "1.3.14", bun run typecheck, bash -n, shellcheck -S warning, and packaging archive verification.
  • Gated .github/workflows/release.yml on needs: ci calling ./.github/workflows/ci.yml, pinned all actions to 40-char commit SHAs, added timeout-minutes: 15, and added a tag parity gate against plugin.json, pyproject.toml, and docs/marketplace-submission.json.
  • Updated scripts/package-plugin.sh with --output-dir, command -v agy fallback warnings, *.test.ts and *.test-helper.ts exclusions, and archive verification in --test mode; set executable mode 0755 on skills/poteto-mode/scripts/hooks/pre_tool_safety.py.
  • Added skills/poteto-mode/scripts/tsconfig.json, updated skills/poteto-mode/scripts/package.json and bun.lock so bun run typecheck checks bootstrap.ts, check-plan.test.ts, and watch-pr/*.ts under --strict --noEmit, pinned bun-types (1.3.14) and typescript (7.0.2), and set "test": "bun test".
  • Added test_version_parity_and_semver, test_example_configs_and_hook_paths, and test_packaging_archive_invariants in tests/test_plugin_manifest.py, required description frontmatter in tests/test_skill_catalog.py, isolated tests/test_simulation_scenario.py in self.base_dir and tests/test_setup_runtime.py doctor main() tests in isolated_home(), replaced silent ruff skips with self.skipTest in tests/test_hooks.py, and aligned Makefile targets (lint, typecheck, doctor, test, package-check, ci).

Tradeoffs

  • Scoped shellcheck to -S warning in .github/workflows/ci.yml and Makefile so existing SC2015 A && B || C idioms in skills/poteto-mode/scripts/worktree-audit.sh pass without refactoring unrelated scripts.
  • Excluded *.test.ts and *.test-helper.ts from distribution archives while keeping runtime .ts scripts required by installed skills.

Blast Radius

Touches CI/release workflows, pyproject.toml, Makefile, scripts/package-plugin.sh, TypeScript configs under skills/poteto-mode/scripts/, hook file mode on pre_tool_safety.py, tests/, and targeted bugbear fixes (B007, B023, B026, B904, B905) in skills/cloud-swarm/scripts/ and skills/setup-agystack/scripts/setup_runtime.py. Existing behavior stays intact across the full test suite.

Verification

  • make ci exited 0 on commit 963e97c.
    • uv run ruff check . exited 0 (All checks passed!).
    • bash -n exited 0 on scripts/package-plugin.sh, skills/poteto-mode/scripts/worktree-audit.sh, and skills/show-me-your-work/scripts/log.sh. shellcheck is absent on the local macOS host and runs in Ubuntu CI.
    • bun run typecheck (tsc --project tsconfig.json --noEmit --strict) and bun test (47 pass, 0 fail, 159 expect() calls across 4 files) exited 0.
    • uv run python skills/setup-agystack/scripts/setup_runtime.py --doctor exited 0 ("status": "OK").
    • uv run pytest -v --timeout=60 tests/ exited 0 (401 passed, 3 skipped, 153 subtests passed in 23.53s; the 3 skipped tests in tests/test_live_cloud_bidirectional.py require AGYSTACK_LIVE_BUCKET). stat -f "%m %N" .slices/harvested_scores.json remained 1795335757 before and after.
    • bash scripts/package-plugin.sh --test verified archive integrity and printed a warning because agy is absent on local PATH.
  • Negative Ruff probe (printf 'undefined_var + 1\n' | uv run ruff check --stdin-filename skills/poteto-mode/scripts/hooks/pre_tool_safety.py -) exited 1 with F821.

@jtaroreh

Copy link
Copy Markdown
Owner Author

Independent Verification Verdict: PASS+NOTES

Verified head SHA: 963e97c0d85dadce62e465e57388bd8594dc7171 (branch chore/ci-release-hardening vs origin/main 9026a809c14d324b88c5e5738e9a720f9ffa7f5).

Diff Inspection Summary (22 files)

  • GitHub Actions (.github/workflows/ci.yml, .github/workflows/release.yml): Verified all 5 external uses: pins resolve via gh api to valid 40-char commit SHAs (actions/checkout@11d5960a326750d5838078e36cf38b85af677262, actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065, astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e, oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6, softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65). Confirmed contents: read workflow permissions (with contents: write scoped to build-and-release), workflow_call support, branch-aware concurrency, timeout-minutes: 15, needs: ci gating in release.yml, and the tag-vs-manifest parity gate against plugin.json, pyproject.toml, and docs/marketplace-submission.json.
  • Ruff & Python Bugbear Fixes (pyproject.toml, skills/cloud-swarm/scripts/, skills/setup-agystack/scripts/setup_runtime.py): Confirmed E4,E7,E9,F,W,B selection, removal of E722 ignore and skills/poteto-mode/scripts/* = ["ALL"] ignore, and safe fixes for B007 (_name, _attempt, _trial_b, _turn), B023 (default-arg bindings in _upload_blob and _ignore_copy), B026 (verified worker/agent_hooks.py positional args match cloud_worker.py emit_tool_invocation and emit_tool_result), B904 (from err chaining), and B905 (strict=True on fixed 2-element tuples in execution.py). Confirmed executable mode 0755 on skills/poteto-mode/scripts/hooks/pre_tool_safety.py.
  • Packaging & TypeScript (scripts/package-plugin.sh, skills/poteto-mode/scripts/): Confirmed --output-dir path resolution, --test temp archive verification, and exclusion of *.test.ts, *.test-helper.ts, __pycache__, and node_modules. Confirmed skills/poteto-mode/scripts/tsconfig.json covers all 12 repository .ts files under --strict --noEmit.
  • Test Isolation & Assertions (tests/): Confirmed tests/test_simulation_scenario.py isolates runs in self.base_dir via contextlib.chdir and cwd=self.base_dir, tests/test_setup_runtime.py wraps all setup_runtime.main() calls in isolated_home(), tests/test_hooks.py calls self.skipTest instead of passing silently if ruff is missing, and tests/test_plugin_manifest.py plus tests/test_skill_catalog.py add manifest parity, hook path, archive invariant, and skill description: checks.

Observed Verification Results on 963e97c0d85dadce62e465e57388bd8594dc7171

  • stat -f "%m %N" .slices/harvested_scores.json: 1795335757 .slices/harvested_scores.json before and after tests; git status --short remained empty.
  • uv sync --frozen --extra test: exit 0 (Checked 47 packages in 11ms).
  • uv run ruff check .: exit 0 (All checks passed!).
  • Negative Ruff probe (printf 'undefined_var + 1\n' | uv run ruff check --stdin-filename skills/poteto-mode/scripts/hooks/pre_tool_safety.py -): exited 1 with F821 Undefined name \undefined_var``.
  • cd skills/poteto-mode/scripts && bun install --frozen-lockfile && bun run typecheck && bun test: exit 0 (tsc --project tsconfig.json --noEmit --strict clean; 47 pass, 0 fail, 159 expect() calls across 4 files).
  • bash -n scripts/package-plugin.sh skills/poteto-mode/scripts/worktree-audit.sh skills/show-me-your-work/scripts/log.sh: exit 0.
  • bash scripts/package-plugin.sh --test: exit 0 (Package archive dry-run verified for agystack v0.17.0 (strict CLI validation skipped) because agy is not on local PATH).
  • Direct archive check via bash scripts/package-plugin.sh --output-dir <tmp>: created agystack-0.17.0.zip with 242 entries, 0 forbidden entries, all 7 runtime .ts scripts included, and 0o100755 mode preserved on skills/poteto-mode/scripts/hooks/pre_tool_safety.py.
  • uv run python skills/setup-agystack/scripts/setup_runtime.py --doctor: exit 0 ("status": "OK").
  • uv run pytest -v --timeout=60 tests/: exit 0 (401 passed, 3 skipped, 153 subtests passed in 24.21s). All 3 skipped cases are in tests/test_live_cloud_bidirectional.py (require AGYSTACK_LIVE_BUCKET); all TestPostToolLintHook ruff tests in tests/test_hooks.py executed and passed.

Notes

  • shellcheck and agy CLI are not installed on the verification host, so agy plugin validate --strict was skipped locally and in CI. GitHub Actions CI run 45005161364 on 963e97c0d85dadce62e465e57388bd8594dc7171 ran and passed shellcheck -S warning on both 3.11 and 3.12 jobs.
  • skills/poteto-mode/scripts/bun.lock retains the pre-existing workspace name "@cursor-skill/poteto-mode-tools" while package.json declares "@agystack/poteto-mode-tools"; bun install --frozen-lockfile still succeeds.

@jtaroreh
jtaroreh merged commit 3a7df99 into main Nov 22, 2026
2 checks passed
@jtaroreh
jtaroreh deleted the chore/ci-release-hardening branch November 22, 2026 12:33
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