Skip to content

WH013 reads the parsed workflow model; delete WorkflowYaml (#971) - #1192

Merged
hyperpolymath merged 5 commits into
mainfrom
claude/happy-sagan-mwnm7h
Nov 16, 2026
Merged

hyperpolymath merged 5 commits into
mainfrom
claude/happy-sagan-mwnm7h

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

WH013 now reads Hypatia.Workflow, as RE001 and RE002 (#1036) and WH014 (#1182) already do. With that, nothing reads Hypatia.WorkflowYaml, the line reader the hardening rules shared, so it is deleted.

This is the WH013 half of the work that followed #1036. #1182 landed WH014 separately, and this change keeps #1182's WH014 code as it is.

Changes

  • A grant is a permissions: value. permissions: {contents: write}, the form WH013's own fix text recommends, now counts as a grant. A run: script that writes contents: write into a file no longer does.
  • Writes, masks and credentials are read from values and keys, not lines.
    • A YAML comment naming git push is not a write.
    • A GH_TOKEN: line that a script writes into a file is not the job's credential.
    • A workflow-level env: written after jobs: is inherited.
  • Flow-style jobs are judged per job. The line reader couldn't split jobs: { … }, so it treated the whole file as one body.
  • An unreadable workflow is reported, not guessed at. It gets a :warn finding at the error line if it names a write, and is skipped otherwise.
  • The line-based rules are unchanged. ResearchExtensions.flow_to_block/1 moves back into that module unchanged, so RE003, RE005 and the WorkflowAudit toolchain check, which still read lines, keep their findings and fixer line numbers.
  • CLAUDE.md file count. The lib/ count is re-measured at 171 (main tracks 172, and this deletes one).

Testing

Run locally under the repo's pinned toolchain, Elixir 1.19.4 on OTP 27.3.4.19, built here because the container had 1.14/OTP 25:

  • Format and warnings: mix format --check-formatted passes across the repo, and the changed modules compile with no warnings (CI uses --warnings-as-errors).
  • Tests: 34 test files touching the workflow rules pass. Only workflow_hardening_test.exs differs from main: 118 tests instead of 104, all passing.
  • Findings differential: I compared main (6f3f16f) with this change, running WorkflowAudit, WorkflowHardening and ResearchExtensions.
    • Every rule gives the same findings on six repository snapshots (hypatia, standards, kyq, rsr-template-repo, choreographic-types, mathesis).
    • WH013 doesn't fire on those trees, so I repeated the comparison on perturbed copies that make it fire (12 WH013 findings), again with identical results.
  • Not run locally: mix deps.get. This environment's network policy blocks hex.pm, so tests ran through elixirc builds. CI runs the real Mix lanes.

Notes


Generated by Claude Code

WH013 now reads Hypatia.Workflow, as RE001, RE002 and WH014 (#1182)
already do. With that, nothing reads Hypatia.WorkflowYaml, the line
reader the hardening rules shared, and it is deleted.

WH013 reads a grant as a `permissions:` value (so `permissions:
{contents: write}` counts, and a script's `contents: write` text does
not). It reads writes and masks from string values, a credential from
token/GH_TOKEN/GITHUB_TOKEN keys, and a step's own continue-on-error,
in any layout. It judges flow-style jobs per job. A writing workflow the
reader refuses is reported at :warn at the error line, as RE001 and
WH014 do, and is skipped otherwise. Seven new WH013 tests fail on main;
an eighth guards a refused workflow that names no write. Six WH014 tests
carried over from the earlier rebuild pass on #1182's WH014.

RE003, RE005 and WorkflowAudit's toolchain-input check still read lines.
ResearchExtensions.flow_to_block/1 moves back into that module
unchanged, so their findings and the fixer's line numbers do not move.

Checked under Elixir 1.19.4 / OTP 27.3.4.19:
- mix format --check-formatted passes, and the changed modules compile
  with no warnings.
- Comparing main (6f3f16f) with this change, every workflow rule gives
  the same findings on six repository snapshots and on perturbed copies,
  including the copies that make WH013 fire (12 findings).
- 34 related test files pass. Only workflow_hardening_test.exs differs
  from main: 118 tests instead of 104, all passing.

CLAUDE.md's lib/ count is re-measured at 171 (172 tracked on main, less
this file).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDithtn5Xk5MbSPm4Px
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 16, 2026 19:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T20:36:20.704180Z 49120bb New commits
🔒 Security Review ❌ Failed 2026-11-16T20:33:06.211212Z
We couldn’t complete this review. Comment @codex security review to try again.
49120bb New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Repository owner deleted a comment from coderabbitai Bot Nov 16, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 16, 2026
@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 16, 2026 19:52

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

ℹ️ 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 thread lib/rules/research_extensions.ex Resolved
Comment thread lib/rules/workflow_hardening.ex Resolved
Codex on #1192: `ResearchExtensions.read_workflow/1` was a public
`@doc false` delegate, and `WorkflowHardening.grants_contents_write_anywhere?/1`
took workflow text. The migration made the first private and the second
accept only the parsed model. No caller in the estate depends on either,
but both are public, so they keep their shape: `read_workflow/1` stays a
public `@doc false` def, and the grant check takes workflow text again,
parsing it and delegating to the model clause. Text the reader refuses
grants nothing.

Two tests; both fail on fc60ab1. Under Elixir 1.19.4 / OTP 27 the format
check passes, the changed modules compile with no warnings, and the
workflow-rule suites pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDithtn5Xk5MbSPm4Px
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 57ee0b74-3dd2-499f-bb8d-0d70410d825b
Commits

Reviewing files that changed from the base of the PR and between 0b8b7d4 and 49120bb.

Files selected for processing: 7

  • .claude/CLAUDE.md
  • CHANGELOG.adoc
  • README.adoc
  • lib/hypatia/workflow_yaml.ex
  • lib/rules/research_extensions.ex
  • lib/rules/workflow_hardening.ex
  • test/workflow_hardening_test.exs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

Validate Documentation's readme-claims check counts the tree and failed on
5735428: "lib/ is 171 in the tree; README.adoc should say 171". Deleting
lib/hypatia/workflow_yaml.ex took the count from 172 to 171; CLAUDE.md
was updated in c3b3c14, README.adoc was not. scripts/check-readme-claims.sh
now reports "counts and local links match the tree".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDithtn5Xk5MbSPm4Px
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 58daef8 into main Nov 16, 2026
105 checks passed
@hyperpolymath
hyperpolymath deleted the claude/happy-sagan-mwnm7h branch November 16, 2026 20:42
hyperpolymath pushed a commit that referenced this pull request Nov 17, 2026
Resolve .claude/CLAUDE.md to main's lib/ count (171, re-measured with
find lib -name "*.ex" | wc -l after #1192 deleted workflow_yaml.ex).

EXPLAINME: the Kin watchdog monitors Safety.RateLimiter and
Safety.Quarantine (lib/kin/watchdog.ex), not the limiter alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CYR5bf5FBLS7cXQK72aVNM
hyperpolymath added a commit to hyperpolymath/echo-types that referenced this pull request Nov 17, 2026
## Change
`HYPATIA_SHA` in `.github/workflows/hypatia-scan.yml` moves from
`7c10e5d` to `6d8ab66`, hypatia's `main` head on 2026-11-16.

The new scanner includes:
- secret-scanning findings that name the secret's file and line, and are
never hidden by path exclusions (hyperpolymath/hypatia#1184);
- the RSR 3.2.2 verdict from the capability reader
(hyperpolymath/hypatia#1188);
- the parsed workflow model for WH013 (hyperpolymath/hypatia#1192);
- the actions-lock proof ledger (hyperpolymath/hypatia#1187).

The workflow's interface to the scanner is unchanged at that commit:
`hypatia-cli.sh` is still there, and the build is still `mix
escript.build`.

## Findings at the new pin
From [run
43967735672](https://github.com/hyperpolymath/echo-types/actions/runs/43967735672)
on `29278de`:
- **Build.** The cache missed, so the scanner was built fresh from
`6d8ab66` ("Generated escript hypatia").
- **Hypatia.** Both the JSON and SARIF scans report `0 findings >=
medium (critical=0, high=0, medium=0, warn=0, low=0, info=0)`, and the
counts step reports critical 0, high 0, total 0. The gating row is 🟢
clean.
- **Alert-backed rules.** These read 0 observations. The job token can
read code-scanning and Dependabot alerts but not secret-scanning alerts,
which need an App or PAT. That limit is unchanged by this PR.

The 🔴 rows in the rendered grid come from **advisory** fleet reporters
at the pinned `gitbot-fleet` revision, not from Hypatia, and this PR
does not change them:
- **rhodibot (RSR):** 11 high. Most expect `.a2ml` descriptiles
(`ANCHOR.a2ml`, `STATE.a2ml`, `0-AI-MANIFEST.a2ml`,
`.machine_readable/descriptiles/` and others). A2ML is retired
estate-wide, so these rules are stale. They are not answered by creating
`.a2ml` files here; rhodibot's criteria need updating to deeds in
gitbot-fleet.
- **finishingbot:** 2 high and 174 medium, mostly docs that name files
which no longer exist (`All.agda`, `Smoke.agda`, `EchoVsQuotient.agda`,
…). This is a docs clean-up for its own PR.
- **glambot:** 1 medium and 136 minor (line length, heading levels).

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

https://claude.ai/code/session_01P4yFkxW5Heb8p2YW7ZYs9F

Co-authored-by: Claude <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.

3 participants