Skip to content

chore: roll out rig (CI gates + harness) and slim agent docs#25

Merged
alex-mextner merged 5 commits into
mainfrom
rig-rollout
Jun 15, 2026
Merged

chore: roll out rig (CI gates + harness) and slim agent docs#25
alex-mextner merged 5 commits into
mainfrom
rig-rollout

Conversation

@alex-mextner

Copy link
Copy Markdown
Owner

What

Rolls out rig to tg-cli and slims AGENTS.md of now-self-advertised generic rules.

Step 1 — chore(rig): apply rig.yaml — CI gates + harness

rig init --yes scaffolded rig.yaml and the per-repo committed artifacts. Global
skills/hooks were already installed machine-wide (rig reported them identical) — only
per-repo files are committed here:

  • .github/workflows/ (additive — existing ci.yml untouched):
    codeql.yml (private-repo SARIF self-gate), dependency-review.yml,
    leftover-grep.yml, review-threads.yml, secret-scan.yml (gitleaks).
  • ci/ — shell companions for the gate workflows
    (dep-audit.sh, leftover-grep.sh, review-threads.sh, secret-scan.sh).
  • .claude/settings.json — harness auto-mode (defaultMode: bypassPermissions).
  • .gitignore — narrowed .claude/ ignore (​.claude/* + !.claude/settings.json)
    so the committed harness file is tracked while local agent state
    (worktrees/, scheduled_tasks.lock) stays ignored.
  • rig.yaml — the declarative source of truth for rig apply.

Step 2 — docs(agents): drop now-self-advertised generic rules (kept project specifics)

The agent-tools skills (installed globally by rig) now self-advertise the generic
engineering rules, so they're removed from AGENTS.md (211 → 198 lines, −13):

  • Removed the "Worktree Trap" section → covered by the worktree-base-trap skill.
  • Removed the "Commit messages: conventional-commit style" line → covered by atomic-commits.

Kept everything tg-cli-specific: the live-symlink CRITICAL section (concrete
~/.files/bin/tg paths), the Specs location pointer, TDD/codex/version-bump
conventions (each holds tg-cli tooling facts), and all Architecture / feature /
gotcha content.

Verification

  • bun test: 997 pass, 0 fail (the stale "~578 tests" note in AGENTS.md is left as-is — soft number, not a rule).
  • git grep confirms no dangling internal links to the removed sections.
  • rig changes outside the repo (global skills/hooks) were NOT committed.

🤖 Generated with Claude Code

alex-mextner and others added 3 commits June 15, 2026 12:53
Scaffolds rig.yaml and the per-repo committed artifacts from `rig init`:
- .github/workflows: codeql (self-gate), dependency-review, leftover-grep,
  review-threads, secret-scan (all additive; existing ci.yml untouched).
- ci/: shell companions for the gate workflows.
- .claude/settings.json: harness auto-mode (defaultMode=bypassPermissions).
- .gitignore: narrow `.claude/` ignore so the committed settings.json is
  tracked while local agent state (worktrees/, scheduled_tasks.lock) stays ignored.

Global skills/hooks were already installed machine-wide (rig reported them
identical); only the per-repo files are committed here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ecifics)

rig installed the agent-tools skills globally, which now self-advertise the
generic engineering rules. Remove the duplicated generic blocks from AGENTS.md,
keeping all tg-cli-specific content (architecture, features, gotchas, conventions).

Removed:
- "Worktree Trap" section — fully covered by the `worktree-base-trap` skill.
- "Commit messages: conventional-commit style" line — covered by `atomic-commits`.

Kept (project-specific): the live-symlink CRITICAL section (carries the concrete
~/.files/bin/tg paths), the Specs pointer (docs/specs/<feature>.md location),
TDD/codex/version-bump conventions (each holds tg-cli tooling facts), and all
Architecture / feature / gotcha content.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…json); rig.yaml is the committed declaration

@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: a20b3dda17

ℹ️ 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".


on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]

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 Trigger the thread gate on review activity

In the workflow I inspected, this gate only re-runs for PR open/update lifecycle events, but GitHub documents that review and diff-comment activity is delivered through pull_request_review / pull_request_review_comment rather than pull_request/pull_request_target (https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request). If a reviewer adds an unresolved thread after review-threads has already passed for the current SHA, no new run is triggered, so a required check can remain green even though unresolved threads now exist; add review/review-comment triggers or another automatic recheck path.

Useful? React with 👍 / 👎.

run: |
# Fetch the PR head object into the local repo so `git diff` can reach it. We do
# NOT check it out and NOT run anything from it — it's only diffed + grepped.
git fetch --no-tags --depth=1 origin "$HEAD_SHA"

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 Fetch enough head history for three-dot diffs

This workflow fetches only the PR head commit, but the scanner later runs git diff "$base...$LEFTOVER_HEAD" in ci/leftover-grep/leftover-grep.sh; I checked git diff -h, which documents the <commit>...<commit> form, and with a depth-1 head fetch Git cannot find a merge base for multi-commit PRs. In that case the gate exits before scanning with fatal: ...: no merge base, so multi-commit PRs are blocked until the head history/PR ref is fetched deeply enough or the diff strategy avoids requiring a local merge base.

Useful? React with 👍 / 👎.

alex-mextner and others added 2 commits June 15, 2026 13:21
Pull in the fixed agent-tools CI gate templates so the new gates stop
hard-failing on a fresh private repo:

- dependency-review: preflight probes the Dependency Graph and skips cleanly
  (with a notice + enable link) when off, instead of erroring with "Dependency
  review is not supported on this repository". Blocks normally once enabled.
- secret-scan (gitleaks): pass GITHUB_TOKEN, now required to scan PRs.
- codeql self-gate: skip a matrix language cleanly when the repo has no source
  for it. Suppress the two by-design actions findings in leftover-grep.yml
  (data-only PR-head fetch) with justified markers.

Also pin oven-sh/setup-bun@v2 to its commit SHA in this repo's own ci.yml
(fixes the CodeQL actions/unpinned-tag finding).

NOTE: the CodeQL JS/TS self-gate still reports 8 pre-existing findings in this
repo's own TypeScript (sanitization / double-escaping / file-system-race in
length-counting + install helpers). Those are the gate working as intended on
real code, not a template defect; they need a separate fix-or-justify decision
by the repo owner and are intentionally left untouched here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ove a finding

Same fix as the template: widen is_source_suppressed to scan the contiguous
comment block above a flagged line so the justified # codeql[...] markers in
leftover-grep.yml actually suppress the by-design actions findings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alex-mextner

Copy link
Copy Markdown
Owner Author

Merging this infra-only rollout despite the red CodeQL Self-Gate (javascript-typescript), with justification:

  • This PR changes only CI workflows (.github/workflows/*), their ci/ shell companions, AGENTS.md, and rig.yaml. It touches no features/** source.
  • The 8 CodeQL JS/TS findings are all in features/** / tests/** code that this PR does not modify — they are pre-existing, surfaced for the first time by the CodeQL self-gate this PR adds. They are the gate working as intended on legacy code, not a regression introduced here.
  • Blocking a security-posture improvement (adding the gates + harness) on unrelated pre-existing findings would be backwards. The findings are tracked for a real fix-or-justify at CodeQL JS/TS: fix-or-justify 8 pre-existing TS findings (surfaced by #25 rig rollout) #31not mass-suppressed.
  • main is not branch-protected; the other gates (gitleaks, dependency-review, CodeQL actions, tests) are all green.

Once #31 lands (fix or justified // codeql[...] markers), the JS/TS self-gate goes green on main on its own.

@alex-mextner alex-mextner merged commit 9d8822d into main Jun 15, 2026
5 of 6 checks passed
@alex-mextner alex-mextner deleted the rig-rollout branch June 15, 2026 12:54
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