Skip to content

Conversation

@rfreel
Copy link
Owner

@rfreel rfreel commented Jan 28, 2026

Motivation

  • Ensure bash scripts under scripts/ralph/ meet basic quality rules (shellcheck/shfmt) before merge.
  • Make the local loop and CI share a single tangent runner to avoid drift between local and CI checks.
  • Improve failure provenance so failing checks capture an error vector and produce a short ledger entry pointing to loop/last_error.txt.

Description

  • Added shellcheck and shfmt local hooks targeting ^scripts/ralph/.*\.sh$ in .pre-commit-config.yaml.
  • Added scripts/ralph/tangent.sh which runs pre-commit run --all-files and uses safe shell flags (set -euo pipefail).
  • Updated scripts/ralph/loop.sh to invoke bash scripts/ralph/tangent.sh (capturing output to a temp file) instead of running pre-commit inline, and to write the error vector into loop/last_error.txt and append a short [ERROR] line to loop/log.txt on failure.
  • Recorded PR progress by appending an [OK] line to loop/log.txt and a PR-1 entry to progress.txt.

Testing

  • No automated tests were run for this change.

Codex Task

Copy link

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

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: f8317cfd2a

ℹ️ 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 on lines +2 to +4
set -euo pipefail

pre-commit run --all-files

Choose a reason for hiding this comment

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

P2 Badge Allow loop to proceed without local pre-commit

Because tangent.sh unconditionally runs pre-commit under set -e, a machine without pre-commit installed now exits 127 and forces loop.sh to fail. That breaks the documented “CI-enforced” path (README.md lines 5 and 10: back-pressure can come from CI and PR-only flow is allowed), which previously tolerated a missing local pre-commit. Consider checking for pre-commit and emitting a non-fatal message so the local loop can still run when relying on CI.

Useful? React with 👍 / 👎.

@rfreel rfreel closed this Jan 28, 2026
@rfreel
Copy link
Owner Author

rfreel commented Jan 28, 2026

c

@rfreel rfreel deleted the codex/harden-tangent-for-bash-quality-enforcement branch January 28, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants