Skip to content

chore: add AGENTS.md, PR template, and CI workflow - #1

Closed
sushilm20 wants to merge 1 commit into
mainfrom
chore/zogwork-workflow
Closed

sushilm20 wants to merge 1 commit into
mainfrom
chore/zogwork-workflow

Conversation

@sushilm20

Copy link
Copy Markdown

What and why

Set up ZOGWORK/mantis governance matching ZOGWORK/control-scout: AGENTS.md, CLAUDE.md, PR template, and cross-platform CI (windows-latest + macos-latest).

Screenshots

No user-visible change.

Tests

Workflow/documentation files only.

@sushilm20

Copy link
Copy Markdown
Author

@loopyreviews-bot review

Comment thread .github/workflows/ci.yml
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 · infra · Windows CI leg cannot compile workspace

The windows-latest leg runs cargo clippy --workspace/cargo test --workspace, but mantis-app unconditionally compiles snapshot.rs, which imports core_graphics, links objc/CoreGraphics frameworks, and expects an AppKit handle; mantis-cli likewise uses mantis_render::gpu, which is #[cfg(target_os = "macos")]-only. That leg will fail to compile rather than test Windows support, so either gate/stub those macOS paths for Windows first or drop windows-latest from the matrix until it can pass.

Trace

Prompt for AI agents
In ZOGWORK/mantis PR #1, file .github/workflows/ci.yml lines 32-32:
Windows CI leg cannot compile workspace. The `windows-latest` leg runs `cargo clippy --workspace`/`cargo test --workspace`, but `mantis-app` unconditionally compiles `snapshot.rs`, which imports `core_graphics`, links `objc`/`CoreGraphics` frameworks, and expects an AppKit handle; `mantis-cli` likewise uses `mantis_render::gpu`, which is `#[cfg(target_os = "macos")]`-only. That leg will fail to compile rather than test Windows support, so either gate/stub those macOS paths for Windows first or drop `windows-latest` from the matrix until it can pass.
Trace: .github/workflows/ci.yml:32 (changed) -> crates/mantis-app/src/main.rs:5 (reads) -> crates/mantis-app/src/snapshot.rs:9 (defect) -> crates/mantis-render/src/lib.rs:12 (defines) -> crates/mantis-cli/src/main.rs:210 (reads).
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

Comment thread .github/workflows/ci.yml
if: runner.os == 'macOS'
run: brew install cmake
- name: Clippy
run: cargo clippy --workspace --all-targets

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 · infra · CI cannot fetch private design-kit dependency

Both check legs build the whole workspace with no credentials beyond actions/checkout, whose token is scoped to this repository, but mantis-app depends on the git dependency mantis-ui and .cargo/config.toml states that design kit is a private repository fetched with the system git's credentials. On a clean hosted runner Cargo will fail fetching mantis-ui before clippy/test run; the workflow needs a credential/token setup for that repository (or a public/vendored dependency) to ever go green.

Trace

Prompt for AI agents
In ZOGWORK/mantis PR #1, file .github/workflows/ci.yml lines 52-52:
CI cannot fetch private design-kit dependency. Both `check` legs build the whole workspace with no credentials beyond `actions/checkout`, whose token is scoped to this repository, but `mantis-app` depends on the git dependency `mantis-ui` and `.cargo/config.toml` states that design kit is a private repository fetched with the system git's credentials. On a clean hosted runner Cargo will fail fetching `mantis-ui` before clippy/test run; the workflow needs a credential/token setup for that repository (or a public/vendored dependency) to ever go green.
Trace: .github/workflows/ci.yml:52 (changed) -> crates/mantis-app/Cargo.toml:20 (reads) -> .cargo/config.toml:8 (defines).
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

Comment thread .github/workflows/ci.yml
Comment on lines +8 to +10
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · state · Main-branch CI cancelled by next merge

cancel-in-progress: true is unconditional and the group is github.ref, so for push events on main a second merge landing while the first merge's CI is still running (the check job alone allows 45 minutes) cancels the first merge's run. That commit is left with a cancelled rather than green/red status, and its post-merge cache saves never complete for later PRs to restore from. Scope cancellation to pull requests, e.g. cancel-in-progress: ${{ github.event_name == 'pull_request' }}.

Trace

Prompt for AI agents
In ZOGWORK/mantis PR #1, file .github/workflows/ci.yml lines 8-10:
Main-branch CI cancelled by next merge. `cancel-in-progress: true` is unconditional and the group is `github.ref`, so for `push` events on `main` a second merge landing while the first merge's CI is still running (the `check` job alone allows 45 minutes) cancels the first merge's run. That commit is left with a cancelled rather than green/red status, and its post-merge cache saves never complete for later PRs to restore from. Scope cancellation to pull requests, e.g. `cancel-in-progress: ${{ github.event_name == 'pull_request' }}`.
Trace: .github/workflows/ci.yml:10 (changed) -> .github/workflows/ci.yml:5 (changed) -> .github/workflows/ci.yml:34 (changed).
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

Comment thread .github/workflows/ci.yml
Comment on lines +19 to +20
fmt:
runs-on: ubuntu-latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · error-handling · Format job can hang six hours

The fmt job sets no timeout-minutes, unlike check's 45-minute bound at line 34, so a hung dtolnay/rust-toolchain download or cargo fmt run burns the GitHub default 360 minutes before failing. Add an explicit short timeout-minutes (e.g. 10) to the fmt job.

Suggested change
fmt:
runs-on: ubuntu-latest
fmt:
runs-on: ubuntu-latest
timeout-minutes: 10
Prompt for AI agents
In ZOGWORK/mantis PR #1, file .github/workflows/ci.yml lines 19-20:
Format job can hang six hours. The `fmt` job sets no `timeout-minutes`, unlike `check`'s 45-minute bound at line 34, so a hung `dtolnay/rust-toolchain` download or `cargo fmt` run burns the GitHub default 360 minutes before failing. Add an explicit short `timeout-minutes` (e.g. 10) to the `fmt` job.
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

Comment thread .github/workflows/ci.yml
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · security · PR code can steal persisted checkout token

Neither actions/checkout@v4 step sets persist-credentials: false (lines 22 and 36), so the contents: read GITHUB_TOKEN is left in .git/config while cargo clippy/cargo test compile and execute PR-controlled build scripts, proc macros, and test binaries. A malicious PR test can read that file and exfiltrate the live token over the runner's network egress; add with: persist-credentials: false to both checkouts (the mantis-ui git dependency is in a different repository, so this token grants no access to it anyway).

Trace

Prompt for AI agents
In ZOGWORK/mantis PR #1, file .github/workflows/ci.yml lines 22-22:
PR code can steal persisted checkout token. Neither `actions/checkout@v4` step sets `persist-credentials: false` (lines 22 and 36), so the `contents: read` `GITHUB_TOKEN` is left in `.git/config` while `cargo clippy`/`cargo test` compile and execute PR-controlled build scripts, proc macros, and test binaries. A malicious PR test can read that file and exfiltrate the live token over the runner's network egress; add `with: persist-credentials: false` to both checkouts (the `mantis-ui` git dependency is in a different repository, so this token grants no access to it anyway).
Trace: .github/workflows/ci.yml:36 (changed) -> .github/workflows/ci.yml:54 (changed).
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

Comment thread .github/workflows/ci.yml
Comment on lines +43 to +47
- name: Cache OpenCascade (.occt)
uses: actions/cache@v4
with:
path: .occt
key: ${{ runner.os }}-occt-8.0.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · error-handling · Failed build poisons immutable OCCT cache

actions/cache@v4 saves in its post-step even when Clippy/Test fail, so a first run interrupted after cadrum has partly populated .occt (CMake/network failure) caches that partial tree under the fixed key ${{ runner.os }}-occt-8.0.1. GitHub caches are immutable and this key has no Cargo.lock/toolchain component, so later runs keep restoring the stale or incomplete tree and can never replace it without manual cache eviction. Split restore/save and only actions/cache/save with if: success(), or include a hash of the OCCT/cadrum inputs in the key.

Trace

Prompt for AI agents
In ZOGWORK/mantis PR #1, file .github/workflows/ci.yml lines 43-47:
Failed build poisons immutable OCCT cache. `actions/cache@v4` saves in its post-step even when `Clippy`/`Test` fail, so a first run interrupted after `cadrum` has partly populated `.occt` (CMake/network failure) caches that partial tree under the fixed key `${{ runner.os }}-occt-8.0.1`. GitHub caches are immutable and this key has no `Cargo.lock`/toolchain component, so later runs keep restoring the stale or incomplete tree and can never replace it without manual cache eviction. Split restore/save and only `actions/cache/save` with `if: success()`, or include a hash of the OCCT/cadrum inputs in the key.
Trace: .github/workflows/ci.yml:47 (changed) -> .cargo/config.toml:4 (reads).
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

Comment thread .github/workflows/ci.yml
uses: actions/cache@v4
with:
path: .occt
key: ${{ runner.os }}-occt-8.0.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · state · Stale OCCT cache survives dependency changes

The .occt cache key is only ${{ runner.os }}-occt-8.0.1, with no runner.arch, toolchain, or hash of Cargo.lock/crates/mantis-cad/Cargo.toml, and actions/cache entries are immutable once saved. If cadrum changes the bundled OpenCascade or a hosted runner changes architecture/OS image, CI keeps restoring the old native build under OCCT_ROOT=.occt and never rebuilds it, so it can link/test a stale kernel or fail on wrong-arch binaries until the cache is manually evicted. Include the architecture and the dependency inputs (e.g. hashFiles('Cargo.lock', 'crates/mantis-cad/Cargo.toml')) in the key.

Trace

Prompt for AI agents
In ZOGWORK/mantis PR #1, file .github/workflows/ci.yml lines 47-47:
Stale OCCT cache survives dependency changes. The `.occt` cache key is only `${{ runner.os }}-occt-8.0.1`, with no `runner.arch`, toolchain, or hash of `Cargo.lock`/`crates/mantis-cad/Cargo.toml`, and `actions/cache` entries are immutable once saved. If `cadrum` changes the bundled OpenCascade or a hosted runner changes architecture/OS image, CI keeps restoring the old native build under `OCCT_ROOT=.occt` and never rebuilds it, so it can link/test a stale kernel or fail on wrong-arch binaries until the cache is manually evicted. Include the architecture and the dependency inputs (e.g. `hashFiles('Cargo.lock', 'crates/mantis-cad/Cargo.toml')`) in the key.
Trace: .github/workflows/ci.yml:47 (changed) -> .cargo/config.toml:4 (reads) -> crates/mantis-cad/Cargo.toml:14 (defines).
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

Comment thread AGENTS.md
## Screenshots and verification

5. **UI changes ship with screenshots, captured before the PR opens.** If the diff changes anything a user sees in `mantis-app` (layout, panels, colors, 3D viewport, controls, dialogs), the PR body embeds at least one screenshot of the rendered change inline — before/after when the change is visual. A link out, a screenshot of code, or a promise to demo later does not satisfy this. A PR with no user-visible change writes `"No user-visible change."` in the template's `## Screenshots` section rather than deleting it, so the reviewer sees the claim and can disagree.
6. **Capture with `scripts/shots.ps1` (Windows) or `MANTIS_SNAPSHOT` (macOS), never ad-hoc scripts.** It runs `mantis` headless via `MANTIS_SNAPSHOT`, `MANTIS_STATE`, `MANTIS_DO`, and `MANTIS_SIZE`, and writes PNGs **outside the repository** (under `$env:TEMP\mantis-shots`). Attach them with the GitHub CLI: `gh pr create --attach 'file.png#alt text'` or `gh pr comment <n> --attach ...`. Never commit screenshots to the repo.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · docs · Mandated screenshot and bundle scripts missing

Rule 6 mandates scripts/shots.ps1 on Windows and forbids ad-hoc alternatives, and the Useful commands list .\scripts\bundle.ps1, but scripts/ contains only bundle.sh, install-remote.sh, make-icon.sh and make-sticker-runtime.sh — no .ps1 files exist at this commit. A Windows contributor following the mandated screenshot workflow (also required by the PR template) hits a missing file with no sanctioned fallback; add the scripts or point the docs at the existing bundle.sh/MANTIS_SNAPSHOT flow.

Trace

Prompt for AI agents
In ZOGWORK/mantis PR #1, file AGENTS.md lines 16-16:
Mandated screenshot and bundle scripts missing. Rule 6 mandates `scripts/shots.ps1` on Windows and forbids ad-hoc alternatives, and the Useful commands list `.\scripts\bundle.ps1`, but `scripts/` contains only `bundle.sh`, `install-remote.sh`, `make-icon.sh` and `make-sticker-runtime.sh` — no `.ps1` files exist at this commit. A Windows contributor following the mandated screenshot workflow (also required by the PR template) hits a missing file with no sanctioned fallback; add the scripts or point the docs at the existing `bundle.sh`/`MANTIS_SNAPSHOT` flow.
Trace: AGENTS.md:16 (changed) -> AGENTS.md:32 (changed) -> scripts/bundle.sh:2 (defines).
Verify this is a real problem; if so, fix it with a minimal change and add a regression test.

@loopyreviews-bot

Copy link
Copy Markdown

Loopy review

Confidence: 3/5 — One or two P1 findings are open; fix them before merging.

Reviewed 4 of 4 changed files.

This PR adds repository governance and CI scaffolding for the ZOGWORK/mantis fork, with no Rust code changes. It introduces contributor rules in AGENTS.md (PR-only workflow, Loopy review gate, pre-push fmt/clippy/test, upstream-compatibility, screenshot and secrets conventions) with CLAUDE.md as a pointer to it, plus a PR template covering what/why, screenshots, and tests. It also adds a GitHub Actions CI workflow running cargo fmt --check on Ubuntu and cargo clippy --workspace --all-targets plus cargo test --workspace across windows-latest and macos-latest, with Rust, Cargo, and OpenCascade (.occt) caching.

Notable changes:

  • Added AGENTS.md and a 3-line CLAUDE.md delegating to it
  • Added .github/pull_request_template.md with Screenshots and Tests sections
  • Added .github/workflows/ci.yml with fmt and cross-platform check jobs, read-only permissions, and concurrency cancellation

Open findings (8)

Finding Location
P1 Windows CI leg cannot compile workspace .github/workflows/ci.yml:32
P1 CI cannot fetch private design-kit dependency .github/workflows/ci.yml:52
P2 Main-branch CI cancelled by next merge .github/workflows/ci.yml:8
P2 Format job can hang six hours .github/workflows/ci.yml:19
P2 PR code can steal persisted checkout token .github/workflows/ci.yml:22
P2 Failed build poisons immutable OCCT cache .github/workflows/ci.yml:43
P2 Stale OCCT cache survives dependency changes .github/workflows/ci.yml:47
P2 Mandated screenshot and bundle scripts missing AGENTS.md:16

Review passes: 4 ran (general, failure-paths, state, authorization).

Reviews: 1 · last reviewed 2c810ed · harness muse/muse-wonder-1.0 · Reply @loopyreviews-bot review to re-run · @loopyreviews-bot remember <rule> to teach Loopy

@sushilm20

Copy link
Copy Markdown
Author

Superseded by the full Windows compatibility + governance PR.

@sushilm20 sushilm20 closed this Nov 30, 2026
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