$ fssg build --deterministic --validate |

How to Add a Read-Only IOSM Review Job to CI

IOSM

I do not want an AI reviewer to become an invisible merge authority. I want it to produce a bounded artifact that engineers can inspect beside tests, lint, and type checks.

That makes the first useful IOSM CI integration deliberately modest: run against the checked-out revision, use the read-only plan profile, emit a machine-readable event stream, and upload the result. The job advises. Deterministic checks still decide whether the build passes.

The boundary before the workflow

IOSM CLI supports print mode for one-shot tasks, a JSON event-stream mode for automation, and a plan profile restricted to read-only tools. Those three surfaces fit CI, but they solve different problems:

Surface Job in the pipeline
-p gives the run one explicit review request
--profile plan prevents the review job from editing the checkout
--mode json preserves structured runtime events as an artifact

This is not an autonomous repair loop. It is not a replacement for tests. It is a review lane with a smaller blast radius.

For the broader runtime model, see IOSM CLI: AI Engineering Runtime. If you need to create baselines and phase artifacts first, use the first IOSM cycle tutorial. Here I am integrating one narrow capability into an existing pipeline.

A minimal GitHub Actions job

IOSM CLI currently requires Node.js 20.6 or newer and an authenticated model provider. Store the provider key as a repository or environment secret; never write it into the workflow file.

name: iosm-review

on:
  pull_request:

permissions:
  contents: read

jobs:
  review:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false

      - uses: actions/setup-node@v4
        with:
          node-version: '20.6'
          cache: npm

      - run: npm ci
      - run: npm install --no-save iosm-cli

      - name: Run bounded IOSM review
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        run: |
          npx iosm \
            --profile plan \
            --mode json \
            --tools read,grep,find,ls \
            -p "Review this revision for correctness risks. Cite files and lines. Do not propose claims without repository evidence." \
            > iosm-review.jsonl

      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: iosm-review
          path: iosm-review.jsonl
          if-no-files-found: error

Pin action revisions and the iosm-cli package version according to your supply-chain policy. The example leaves versions readable; a production repository should decide whether lockfile pinning, immutable action SHAs, or an internal package mirror is required.

Why the job is read-only twice

The workflow sets GitHub token permissions to contents: read, and IOSM runs with the plan profile plus an explicit read-only tool allowlist. These controls are not redundant.

GitHub permissions constrain what the workflow token can do to the repository. The IOSM profile and tool list constrain what the agent runtime can do inside the runner. A job can have no push permission and still mutate its local checkout, execute an unwanted command, or generate misleading state. Defense should exist at both boundaries.

I also disable persisted checkout credentials. The review does not need them after cloning. Removing ambient authority is cheaper than asking a model to ignore it.

Keep the output as evidence, not as a verdict

The raw JSON stream is valuable because it preserves more than a final paragraph. It can be archived, parsed, compared, or transformed into a human-facing summary later. But machine-readable does not mean objectively correct.

I would keep this job non-blocking during the first adoption period. Review its findings against actual defects and false positives. Only deterministic properties should become merge gates directly:

unit tests      -> blocking
lint/typecheck  -> blocking
policy checks   -> blocking
IOSM review     -> advisory artifact

If the review discovers a repeatable rule—an illegal dependency edge, a forbidden API use, or a missing schema validation—promote that rule into code, lint, policy, or a fitness function. The agent is useful for discovering candidate invariants. CI should enforce mature invariants without needing the agent to reinterpret them on every run.

Make failure semantics explicit

There are three different failures:

  1. the repository fails a deterministic check;
  2. IOSM completes and reports a risk;
  3. the IOSM job cannot run because the provider, network, package install, or runtime fails.

Do not collapse them into one red badge. The sample command exits according to the runtime process, while the artifact upload uses if: always() so partial output remains inspectable. Teams that mark the job non-blocking should still surface infrastructure failure clearly; otherwise “no findings” and “no review happened” look identical.

A practical rollout is:

  • observe: artifact only, no required status;
  • calibrate: label confirmed findings and false positives outside the public report;
  • extract: turn stable findings into deterministic rules;
  • tighten: require the deterministic rule, not the model's confidence.

This is the IOSM pattern in miniature: improvement creates knowledge, optimization reduces review cost, shrinking removes vague prompt surface, and modularization moves stable policy into the right component.

What this integration does not prove

The workflow does not prove that the review is complete, reproducible across models, or suitable for unattended merge decisions. Provider behavior, model versions, repository size, and prompt context can change the output. A JSONL file gives traceability, not determinism.

That limitation is exactly why I like this architecture. It gives probabilistic analysis a useful place without letting it impersonate a deterministic gate. The model can widen attention. The pipeline keeps authority.

Sources

FACET AI CLI Terminal
facet@ai:~$