8000 ci: skip code checks for documentation changes by dominicnunez · Pull Request #200 · dominicnunez/agentos · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 52 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: ci
on:
push:
pull_request:
permissions:
contents: read
security-events: write
name: ci

on:
push:
pull_request:

permissions:
contents: read
security-events: write

jobs:
verify:
name: CI verification (${{ github.event_name }})
Expand All @@ -18,20 +18,29 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Select applicable checks
id: scope
run: python3 scripts/ci_scope.py
- name: Verify change classification
run: python3 -m unittest scripts/test_ci_scope.py
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
if: steps.scope.outputs.code != 'false'
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
if: steps.scope.outputs.code != 'false'
with:
node-version: 24.19.0
package-manager-cache: false
- name: Enable pinned pnpm
if: steps.scope.outputs.code != 'false'
run: |
corepack enable
corepack prepare pnpm@11.19.0 --activate

- name: Dashboard dependency and type checks
if: steps.scope.outputs.code != 'false'
working-directory: web/dashboard
run: |
pnpm install --frozen-lockfile --ignore-scripts
Expand All @@ -41,6 +50,7 @@ jobs:
pnpm test

- name: Reproduce embedded dashboard
if: steps.scope.outputs.code != 'false'
working-directory: web/dashboard
run: |
pnpm build
Expand All @@ -49,12 +59,16 @@ jobs:
printf '%s\n' "$dashboard_status"
exit 1
fi
- run: go mod download

- name: Download Go modules
if: steps.scope.outputs.code != 'false'
run: go mod download

- name: Formatting
if: steps.scope.outputs.code != 'false'< 10BC8 /td>
run: test -z "$(gofmt -l .)"

- name: Module consistency
if: steps.scope.outputs.code != 'false'
run: go mod tidy -diff

- name: Controlled AIMS documented information
Expand Down Expand Up @@ -96,9 +110,11 @@ jobs:
cmp work/aims-first/agentos-aims-assessment.tar.gz work/aims-second/agentos-aims-assessment.tar.gz

- name: Build
if: steps.scope.outputs.code != 'false'
run: go build ./...

- name: Version contract
if: steps.scope.outputs.code != 'false'
run: |
mkdir -p work
version=$(tr -d '\r\n' < VERSION)
Expand All @@ -108,21 +124,27 @@ jobs:
test "$(./work/agentos-recovery-version --version)" = "$version"

- name: Vet
if: steps.scope.outputs.code != 'false'
run: go vet ./...

- name: Lint
if: steps.scope.outputs.code != 'false'
run: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4 run

- name: Race-tested unit tests
if: steps.scope.outputs.code != 'false'
run: go test -race ./...

- name: Bounded operator-boundary fuzzing
if: steps.scope.outputs.code != 'false'
run: go test ./internal/gateway -run=^$ -fuzz=FuzzOperatorWorkContent -fuzztime=10s -parallel=4

- name: Vulnerability scan
if: steps.scope.outputs.code != 'false'
run: go run golang.org/x/vuln/cmd/govulncheck@v1.6.0 ./...

- name: Linux binary boundary
if: steps.scope.outputs.code != 'false'
run: |
version=$(tr -d '\r\n' < VERSION)
go build -ldflags "-X main.version=$version" -o work/agentos ./cmd/agentos
Expand All @@ -134,19 +156,20 @@ jobs:
grep --fixed-strings "No valid installation" work/doctor.log

- name: Architecture boundaries
if: steps.scope.outputs.code != 'false'
run: go tool archguard check --include-tests --profile modular-monolith
- name: Gallow advisory SARIF
if: github.event_name == 'pull_request'
continue-on-error: true
run: |
git fetch origin "${{ github.base_ref }}" --depth=1
go tool gallow audit --base "origin/${{ github.base_ref }}" --format sarif > gallow.sarif
- name: Upload Gallow SARIF
if: github.event_name == 'pull_request' && hashFiles('gallow.sarif') != ''
continue-on-error: true

- name: Gallow advisory SARIF
if: steps.scope.outputs.code != 'false' && github.event_name == 'pull_request'
continue-on-error: true
run: |
git fetch origin "${{ github.base_ref }}" --depth=1
go tool gallow audit --base "origin/${{ github.base_ref }}" --format sarif > gallow.sarif

- name: Upload Gallow SARIF
if: steps.scope.outputs.code != 'false' && github.event_name == 'pull_request' && hashFiles('gallow.sarif') != ''
continue-on-error: true
uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4
with:
sarif_file: gallow.sarif
category: gallow
with:
sarif_file: gallow.sarif
category: gallow
22 changes: 22 additions & 0 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@ jobs:
name: Dashboard frontend
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
code: ${{ steps.scope.outputs.code }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Select applicable checks
id: scope
run: python3 scripts/ci_scope.py
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
if: steps.scope.outputs.code != 'false'
with:
node-version: 24.19.0
package-manager-cache: false
- name: Reproduce embedded dashboard and license evidence
if: steps.scope.outputs.code != 'false'
working-directory: web/dashboard
run: |
corepack enable
Expand All @@ -43,20 +51,30 @@ jobs:
verify:
name: Release artifact verification
needs: frontend
if: always()
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Require successful prerequisite
if: needs.frontend.result != 'success'
run: |
echo 'Frontend check did not complete successfully.' >&2
exit 1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
if: needs.frontend.outputs.code != 'false'
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
if: needs.frontend.outputs.code != 'false'
with:
go-version-file: go.mod
cache: false
- uses: actions/setup-python@8549b9f8f590ad24eab7482f36f6e1e24d34597b # 2026-08-03
if: needs.frontend.outputs.code != 'false'
with:
python-version-file: .python-version
- name: Build and verify release-candidate artifacts
if: needs.frontend.outputs.code != 'false'
env:
GOCACHE: ${{ runner.temp }}/agentos-gocache-a
GOMODCACHE: ${{ runner.temp }}/agentos-gomodcache-a
Expand All @@ -65,6 +83,7 @@ jobs:
(cd "$RUNNER_TEMP/agentos-release-a" && sha256sum --check SHA256SUMS)

- name: Verify byte reproducibility
if: needs.frontend.outputs.code != 'false'
env:
GOCACHE: ${{ runner.temp }}/agentos-gocache-b
GOMODCACHE: ${{ runner.temp }}/agentos-gomodcache-b
Expand All @@ -75,6 +94,7 @@ jobs:
"$RUNNER_TEMP/agentos-release-b"

- name: Verify packaged licenses and corresponding source
if: needs.frontend.outputs.code != 'false'
env:
GOCACHE: ${{ runner.temp }}/agentos-source-gocache
GOMODCACHE: ${{ runner.temp }}/agentos-source-gomodcache
Expand Down Expand Up @@ -106,6 +126,7 @@ jobs:
GOPROXY=off GOSUMDB=off go test -mod=vendor ./...

- name: Smoke-test packaged Linux amd64 binaries
if: needs.frontend.outputs.code != 'false'
run: |
version=$(tr -d '\r\n' < VERSION)
package_directory="$RUNNER_TEMP/agentos-package"
Expand All @@ -122,6 +143,7 @@ jobs:
grep --fixed-strings "No valid installation" "$RUNNER_TEMP/agentos-doctor.log"

- name: Exercise installed Linux system lifecycle offline
if: needs.frontend.outputs.code != 'false'
env:
GOCACHE: ${{ runner.temp }}/agentos-installed-gocache
GOMODCACHE: ${{ runner.temp }}/agentos-installed-gomodcache
Expand Down
4 changes: 3 additions & 1 deletion docs/THREAT_MODEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The principal assets are organization, Mission, Goal, Work, Task, identity, know

There is no published release yet according to `SECURITY.md`, so release-publication risk is prospective. The intended default is a single-machine system installation with a restricted `agentos` service account and one verified Linux owner. User-mode installations run with the owner's authority. Organization scoping remains security-relevant for external actors, ledger objects, model context, and budgets, without implying strong hosted multi-tenant isolation.

This model describes runtime commit `e57e792069c3bc5b39c4b7b884af6a741adb626f`. Implemented controls, incomplete controls, and prerequisites for unsupported execution mechanisms are distinguished below. A passing test is evidence for a control, not proof of comprehensive security.
This model describes code commit `fcef695b591259b2c16b5790b59bb0d5fa09c1b5`, including its CI controls. Implemented controls, incomplete controls, and prerequisites for unsupported execution mechanisms are distinguished below. A passing test is evidence for a control, not proof of comprehensive security.

# 2. Threat model, Trust boundaries and assumptions

Expand Down Expand Up @@ -164,6 +164,8 @@ Setup faces wrong-owner binding, PATH substitution, symlink replacement, unsafe

CI pins actions and tool versions, controls frontend dependency installation, audits dependencies, verifies embedded assets, exercises race/adversarial tests and bounded fuzzing, checks architecture, and builds reproducible archives with checksums, SBOMs, licenses, provenance, and corresponding source.

Ordinary documentation-only changes skip code-related steps while retaining document validation and required job results. The classifier checks a complete local Git diff, including deleted paths and file modes; scripts, schemas, workflows, dependencies, configuration, executable files, and unknown paths still require full checks. Uncertain classification also requires full checks. Release verification fails when its frontend prerequisite does not succeed. Required reviews remain independent, including security review for threat-model changes. The classifier and workflow definitions remain trusted source inputs subject to review; adding a code consumer of an allowed document path requires revisiting that classification. See `docs/development/CI.md` for the exact scope.

These checks do not prove live-provider behavior, deployment safety, or absence of vulnerabilities. Provenance is unsigned, publication is separately controlled, and compromise of repository administration, builders, toolchains, or dependency sources remains a supply-chain threat.

# 4. Criticality calibration
Expand Down
44 changes: 44 additions & 0 deletions docs/development/CI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Applicable GitHub checks

Ordinary documentation changes retain document validation and skip code builds,
code tests, dependency audits, frontend checks, and release-artifact checks.
Required jobs still report a result so branch protection can complete. The
workflow itself is not excluded with a path filter.

The shared `scripts/ci_scope.py` classifier examines the complete Git diff for
each run. Pull requests compare the base commit with the tested merge commit.
Branch pushes compare the previous and new commits. A new branch uses its unique
common ancestor with the fetched default branch, when available.

Documentation-only changes can include:

- Non-executable `.md`, `.txt`, `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.svg`,
and `.pdf` files under `docs/`.
- Root `AGENTS.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, `README.md`, and `SECURITY.md`.
- Markdown files under `governance/aims/`.

All other paths run full code checks. In particular, schemas, scripts, workflow
definitions, dependencies, runtime configuration, `LICENSE`, and `NOTICE` are
code-related inputs even when a file is under `docs/`. Deleting the packaged
root `README.md`, changing a document into an executable or symbolic link, or
moving code into a document path also runs full checks. When adding a new code
consumer of document files, update the classifier and its tests in the same PR.
Filenames must be valid UTF-8, as required by the source archive builder;
otherwise full checks run even for a path with a documentation extension.

Missing or invalid revisions, failed Git inspection, an empty diff, and unknown
events require full checks. Tag pushes and manual release-artifact verification
also run full checks. The classifier reads local Git objects without fetching
additional history or running external diff helpers.

The required `CI verification (pull_request)`, `Dashboard frontend`, and
`Release artifact verification` job names remain unchanged. Code steps run unless
the classifier explicitly returns `false`. Release verification fails if its
frontend prerequisite fails or is cancelled. Document verification, document
history and assessment-bundle checks, and classifier regressions remain active.
The existing history-verification rules are unchanged.

Skipping code checks does not waive reviews. Follow `AGENTS.md` for review
sequencing; changes to `docs/THREAT_MODEL.md` still require security review after
a clean general review. Workflow changes themselves require full code checks
and security review.
Loading
0