Skip to content

fix(ci): mythos-auto aggregate uses curl not gh; register p3_stream.rs#175

Merged
avrabe merged 1 commit into
mainfrom
fix/mythos-auto-aggregate-gh-curl
May 20, 2026
Merged

fix(ci): mythos-auto aggregate uses curl not gh; register p3_stream.rs#175
avrabe merged 1 commit into
mainfrom
fix/mythos-auto-aggregate-gh-curl

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 20, 2026

Summary

Fifth mythos-auto plumbing fix — and it unblocks the auto-runner end-to-end.

On PR #173, the mythos-auto scan ran end-to-end for the first time: claude-code-action applied the Mythos discover protocol to merger.rs and resolver.rs and returned NO_FINDINGS for both. But the aggregate job — which composes the sticky comment and applies the mythos-pass-done label — exited 127:

/var/lib/runners/runner8/_work/.../d339fc7e.sh: line 53: gh: command not found

gh (GitHub CLI) is not installed on the light runner. So the label never auto-applied and the label-only Mythos delta-pass gate failed downstream — even though the actual Mythos verdict was clean.

Changes

Change Detail
Comment upsert: gh apicurl List/PATCH/POST against the REST API. curl + jq are universally present; gh is not.
Label apply: gh pr editcurl POST to the labels endpoint (adds without clobbering). Label step gains REPO env.
Body JSON-encoding jq -Rs '{body: .}' reads the markdown file as one raw string — newlines, quotes, emoji, backticks, model-authored hypothesis text all escaped, nothing breaks the request body.
curl -fsS Fails loudly on HTTP error rather than silently posting nothing.
Register p3_stream.rs Tier-5 Added to the path lists in mythos-gate.yml + mythos-auto.yml — deferred from #173.

Why p3_stream.rs registration rides here

claude-code-action self-validates that the workflow invoking it has content identical to main (a security measure). So a PR cannot both modify mythos-auto.yml and be scanned by it — that's what blocked #173's first run. This PR touches only the two workflow files — no Tier-5 source — so its own auto-runner detect job finds nothing to scan, any=false, the scan job skips, and the self-validation never runs. Clean.

The 5 mythos-auto plumbing bugs (now all fixed)

  1. unzip missing on rust-cpu runners (smithy: unzip missing on rust-cpu runners blocks claude-code-action #167, smithy-side)
  2. slug step ordering (fix(ci): mythos-auto plumbing — slug ordering, unzip install #164)
  3. id-token: write permission (fix(ci): drop musl target from fuzz.yml + add id-token to mythos-auto (#168) #170)
  4. workflow self-validation vs PRs modifying mythos-auto.yml (handled by feat(p3): cross-component stream<T> pairing detection (#141, ADR-3) #173 revert + this PR's no-Tier-5-source design)
  5. gh absent on light runner — this PR

After this lands, the next Tier-5 PR should run mythos-auto fully green: detect → scan (NO_FINDINGS) → aggregate (curl posts comment + label) → gate clears.

Test plan

🤖 Generated with Claude Code

Fifth mythos-auto plumbing fix. The `aggregate` job composed the
sticky PR comment and applied the `mythos-pass-done` label with
`gh api` / `gh pr edit`. The GitHub CLI is not installed on the
`light` runner, so the step exited 127:

  /var/lib/runners/runner8/_work/.../d339fc7e.sh: line 53:
    gh: command not found

On PR #173 the Mythos scan ran end-to-end and returned NO_FINDINGS
for both touched Tier-5 files, but this `gh`-absent aggregate bug
meant the label never auto-applied and the label-only
`Mythos delta-pass gate` failed downstream.

Fix:
- Sticky-comment upsert and label apply rewritten with `curl`
  against the GitHub REST API. `curl` and `jq` are universally
  present on the runners; `gh` is not.
- The markdown body is JSON-encoded via `jq -Rs '{body: .}'` — the
  whole file as one raw string — so newlines, quotes, emoji,
  backticks, and the model-authored hypothesis text are all escaped
  and cannot break out of the JSON request body.
- `curl -fsS` fails loudly on an HTTP error rather than silently
  posting nothing.
- The label step gains `REPO` in its env (the labels endpoint needs
  the repo path); the labels POST adds without clobbering existing
  labels.

Also registers `meld-core/src/p3_stream.rs` (introduced in #173) in
the Tier-5 path lists of both mythos-gate.yml and mythos-auto.yml.
This was deferred from #173: claude-code-action self-validates that
the workflow invoking it has content identical to `main`, so a PR
cannot both modify `mythos-auto.yml` and be scanned by it. This PR
touches only the two workflow files — no Tier-5 source — so its own
auto-runner detect job finds nothing to scan and skips cleanly,
sidestepping the self-validation collision.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

LS-N verification gate

19/19 approved LS entries verified

count
Passed (≥1 test, all green) 19
Failed (≥1 test failure) 0
Missing (no ls_*_NN_* test found) 0

Approved loss-scenarios.yaml entries are expected to have a
regression test named ls_<letter>_<num>_* (e.g. LS-A-11
ls_a_11_*). The gate runs each prefix via cargo test --lib --no-fail-fast and aggregates pass/fail/missing.

Failed LS entries

(none)

Missing regression tests

(none)

Updated automatically by tools/post_verification_comment.py.
Source of truth: safety/stpa/loss-scenarios.yaml.

@avrabe avrabe merged commit f65bdc7 into main May 20, 2026
14 checks passed
@avrabe avrabe deleted the fix/mythos-auto-aggregate-gh-curl branch May 20, 2026 19:07
@avrabe avrabe mentioned this pull request May 20, 2026
2 tasks
avrabe added a commit that referenced this pull request May 21, 2026
P3 cross-component stream-pair detection foundation + a fully
operational Mythos delta-pass auto-runner. 12 commits since v0.8.1.

Headline changes:

- Cross-component stream<T> pairing detection (#141, ADR-3). The
  StreamPairGraph foundation for the in-module stream adapter: meld
  now inventories at resolve time which fused components form
  producer -> consumer stream pairings. The ring-buffer / copy-chain
  emitter is a runtime-verified follow-up (ADR-3 Path N).

- Mythos delta-pass auto-runner (#162, #164, #170, #173, #175). The
  AI-driven discover protocol now runs automatically on every
  Tier-5 PR by the maintainer, via claude-code-action on a Max-plan
  OAuth token. Five plumbing fixes brought it to a working
  end-to-end state: scan -> NO_FINDINGS verdict -> sticky comment ->
  mythos-pass-done label.

- LS-N verification gate (#161, #165). Every approved loss-scenario
  in safety/stpa/loss-scenarios.yaml is now enforced to have a
  matching ls_<letter>_<num>_* regression test; 19/19 verified.

- DWARF / witness-mapping discovery (#131) — Phase 1 of the #130
  epic; pins today's lossy passthrough as the green-to-red oracle
  for the Phase 2 remap work.

- Regression coverage for LS-A-8/9/19 and LS-CP-4 (#163/165/166/169)
  — closed every missing-test entry the LS-N gate surfaced.

- CI footprint reduction (#171) — bench/fuzz/ci skip on docs- and
  safety-only PRs; meld is a leaner consumer of the shared fleet.

- fuzz.yml musl-target drop (#170, closes #168) — fixes the
  recurring "sanitizer incompatible with statically linked libc"
  fuzz failures.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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