Commit Graph

3 Commits

Author SHA1 Message Date
Bo 0b28794f2c chore(scripts): CI script hygiene — portable paths + generator quoting (#trivial) (#401)
## What

Two small CI-script hygiene fixes from the v2.41.1→main audit (Wave 0,
PR-1 of the 3.0-alignment plan):

1. **`inventory-jsm-skills.sh`** — replace hardcoded `/Users/bo` macOS
paths with `$HOME`, so the inventory resolves skills on Linux/CI instead
of silently returning an empty result. (bead `agentops-yxid`)
2. **`add-validate-job.sh`** — quote `${HELPER_SCRIPT}` in the generated
workflow + pre-push bash so scaffolded jobs are shellcheck-clean. Uses
escaped quotes inside the double-quoted templates (the bare-quote first
attempt broke the template string — caught by shellcheck SC2027/SC1078).
(bead `agentops-obef`)

## Test plan

- `shellcheck --severity=error` clean on both files (CI parity)
- full `shellcheck` clean on both files
- `bash -n` syntax OK
- `add-validate-job.sh ... --dry-run` shows correctly quoted generated
output:
`chmod +x "scripts/..."`, `[[ -f "scripts/..." ]]`, `bash "scripts/..."`
- `scripts/pre-push-gate.sh --fast` passed

Closes-scenario: agentops-yxid#ci-portable-paths
Closes-scenario: agentops-obef#ci-genbash-quoting
Bounded-context: BC5-Runtime
Evidence: pre-push-gate --fast passed; shellcheck clean; dry-run quoted
output verified

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-22 12:09:28 -04:00
Bo fcacbed3f9 fix(scripts): clean 6 pre-existing shellcheck warnings (soc-j026) (#349)
## Summary

Child arc of `soc-l4n8` (drift surfaced during #348). Mechanical cleanup
of 6 pre-existing shellcheck warnings in scripts I did not previously
touch — all SC2034 unused-vars, SC2088 intended-literal, SC2089/SC2090
template-string, SC2221/SC2222 redundant-case.

Per anti-pattern #2 (no bundling pre-existing fixes), filed as an atomic
side-quest off the #348 `soc-1lp1` PR rather than bundled into it.

Closes: soc-j026
Discovered-from: soc-l4n8

## Diff

| File | Fix |
|---|---|
| `validate-codex-api-conformance.sh:59` | SC2088 disable directive —
grep is intentionally matching the literal documented path |
| `goal-failure-taxonomy.sh:30` | Trim redundant case patterns
(`*toolchain-security*`, `*release-security*`, `*ci-security*` all
already matched by `*security*`) |
| `purge-global-garbage.sh:24` | Remove unused `bodylen` |
| `nightly-pr-digest.sh:316` | Remove unused `landing_policy` (local +
assignment) |
| `add-validate-job.sh` | File-level SC2089/SC2090 disable for the
template-string section |
| `check-skill-size.sh:34` | Remove unused `name` |

## Validation

- `shellcheck -S warning` clean on all 6 files.
- `scripts/ship.sh` routes to `--fast` (no inventory touched).
- Pre-push gate (fast): PASSED, 31 skipped, 1 advisory WARN
(executable-spec, unrelated).

Bounded-context: BC0-foundations (scripts)
Evidence: `shellcheck -S warning scripts/*` (clean for the 6 files)

Co-authored-by: Codex <codex@example.invalid>
2026-05-19 10:52:40 +00:00
Bo ec22c23bac feat(scripts): add-validate-job scaffolder atomically wires new CI jobs (soc-3oij) (#315)
## What

Adds `scripts/add-validate-job.sh` — atomically scaffolds a new
`validate-*` CI job across all 5 touch-points in one command.

## Why

Adding a new validate-* job currently requires hand-edits to **5+ files
in lockstep**:

| Surface | What needs editing |
|---|---|
| `.github/workflows/validate.yml` | new job block |
| `.github/workflows/validate.yml` | summary.needs list entry |
| `.github/workflows/validate.yml` | summary echo line |
| `scripts/pre-push-gate.sh` | new always-runs section |
| `tests/scripts/pre-push-gate.bats` | make_stub for helper script |
| `AGENTS.md` | CI Jobs table row |

Missing any one triggers cascading CI failures across multiple gates. I
hit this exact failure **twice this session** while shipping the
soc-zxia (registries-drift remediation) epic — missing AGENTS rows broke
`validate-ci-policy-parity`; missing bats stubs broke `bats-tests` +
`agentops-contract-canaries`.

This PR is the **meta-fix**: the same registries-drift pattern that
soc-zxia closed for the DDD docs layer, applied to the CI integration
layer.

## Usage

```bash
scripts/add-validate-job.sh validate-my-thing \
  --script scripts/check-my-thing.sh \
  --reason "What this validates (AGENTS table column)" \
  --failure "Common failure mode (AGENTS table column)" \
  [--python]   # if the helper needs pip install pyyaml
  [--dry-run]  # show patches without applying
```

## Properties

- **Idempotent**: re-running with same args is a no-op (conflict
detection on job-name uniqueness)
- **Input validation**: job-name format (`validate-<kebab>`),
helper-script existence, all required surface files present, missing
required flags
- **Dry-run mode**: preview all 6 patches before applying
- **Single command**: no chance to miss a touch-point

## Anchors

The scaffolder inserts before known anchors in each surface:

| Surface | Insertion anchor |
|---|---|
| workflow job block | before `validate-flywheel-proof:` |
| summary.needs | before `validate-flywheel-proof,` |
| summary echo | before flywheel-proof echo line |
| pre-push gate | before `# --- 22d. Flywheel-proof` |
| bats stubs | after make_stub for `proof-run.sh` |
| AGENTS table | before validate-flywheel-proof row |

## Verification (dry-run)

Tested against a hypothetical `validate-example` job — scaffolder
produces correct, well-formed patches for all 6 touch-points. Wet-run
validates on the next real validate-* job addition.

## Acceptance

- [x] `scripts/add-validate-job.sh` exists, executable, has `--help`
- [x] Validates inputs (job name format, script existence, conflict
detection)
- [x] Dry-run shows correct patches for all 6 touch-points
- [x] Linked from `docs/documentation-index.md`
- [x] Lands via PR (dogfoods the discipline)

## Related

- Filed-from: soc-zxia (Domain-tightening epic that exposed this need)
- Closes: soc-3oij
- Companion follow-ups (future beads):
- soc-m6tp — generate AGENTS.md CI table from validate.yml (reduces from
6 surfaces to 5)
  - soc-xban — auto-discover bats helper stubs (reduces from 5 to 4)
  - soc-hwgm — fix TestRunInit* global state flake under -shuffle

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-18 14:05:00 +00:00