-
Notifications
You must be signed in to change notification settings - Fork 0
chore: CI lint jobs, templates, policy files #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b9e0e81
29e198d
56f96e4
826e0d7
b1a0309
eabb153
3c6accd
081ff62
156d0ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Every path requests review from the maintainer. The recipe and docs | ||
| # lines exist so a recipe PR shows who reviews it, even while that is | ||
| # the same person. | ||
| * @NovusEdge | ||
| /internal/recipes/bundled/ @NovusEdge | ||
| /docs/recipes/ @NovusEdge |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Bug | ||
| description: stoat did something wrong | ||
| labels: [bug] | ||
| body: | ||
| - type: input | ||
| id: version | ||
| attributes: | ||
| label: stoat version | ||
| description: Output of `stoat --version` | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: host | ||
| attributes: | ||
| label: Host distro and kernel | ||
| description: Output of `uname -sr` and the distro name | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: guest | ||
| attributes: | ||
| label: Guest OS and mode | ||
| description: For example `alpine live`, `ubuntu cloud`, `debian disk` | ||
| - type: textarea | ||
| id: doctor | ||
| attributes: | ||
| label: stoat doctor | ||
| description: Paste the output of `stoat doctor` | ||
| render: text | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: what | ||
| attributes: | ||
| label: What happened | ||
| description: The command or key you pressed, what you expected, what you saw | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: log | ||
| attributes: | ||
| label: Log tail | ||
| description: Paste the last 50 lines of `~/.stoat/logs/stoat.log` and, for a provisioning problem, `~/.stoat/<vm>/last-provision.log` | ||
| render: text | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| blank_issues_enabled: true | ||
| contact_links: | ||
| - name: Security issue | ||
| url: https://github.com/NovusEdge/stoat/security/advisories/new | ||
| about: Report a vulnerability privately |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Guest OS | ||
| description: Request support for a guest OS | ||
| labels: [guest] | ||
| body: | ||
| - type: input | ||
| id: name | ||
| attributes: | ||
| label: OS name and version | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: image | ||
| attributes: | ||
| label: Cloud image URL | ||
| description: A qcow2 or raw image with cloud-init, if one exists | ||
| - type: dropdown | ||
| id: init | ||
| attributes: | ||
| label: Init system | ||
| options: [systemd, openrc, rc, other] | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: pkg | ||
| attributes: | ||
| label: Package manager | ||
| description: For example `apt`, `dnf`, `pkg` | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: notes | ||
| attributes: | ||
| label: Notes | ||
| description: Default ssh user, whether sudo or doas ships, anything the installer needs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Recipe | ||
| description: A bundled recipe is broken, or you want a new one | ||
| labels: [recipes] | ||
| body: | ||
| - type: dropdown | ||
| id: kind | ||
| attributes: | ||
| label: Kind | ||
| options: | ||
| - A bundled recipe fails | ||
| - Request for a new recipe | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: recipe | ||
| attributes: | ||
| label: Recipe name | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: guest | ||
| attributes: | ||
| label: Guest OS and mode | ||
| description: For example `fedora cloud` | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: detail | ||
| attributes: | ||
| label: Detail | ||
| description: For a failure, paste `~/.stoat/<vm>/last-provision.log`. For a request, say what the recipe installs and which guests it should support. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
printf '%s\n' '--- issue template ---'
sed -n '1,80p' .github/ISSUE_TEMPLATE/recipe.yml
printf '%s\n' '--- security policy ---'
if [ -f SECURITY.md ]; then sed -n '1,180p' SECURITY.md; fi
printf '%s\n' '--- log references ---'
rg -n --hidden -g '!node_modules' -g '!dist' 'last-provision\.log|provision.*log|\.stoat' .Repository: NovusEdge/stoat Length of output: 22079 🏁 Script executed: #!/bin/bash
printf '%s\n' '--- log implementation ---'
cat -n internal/logx/logx.go
printf '%s\n' '--- provisioning writer ---'
sed -n '180,245p' internal/sshx/sshx.go
printf '%s\n' '--- recipe logging guidance ---'
sed -n '1,45p' docs/recipes/writing-your-own.md
printf '%s\n' '--- log contract ---'
sed -n '115,140p' docs/concepts/modes-and-backends.mdRepository: NovusEdge/stoat Length of output: 8505 Sensitive Data Exposure (CWE-200): Exposure of Sensitive Information to an Unauthorized Actor Reachability: External · Exploitability: Trivial Add a provisioning-log redaction warning. Because recipe output is written directly to 🤖 Prompt for AI Agents |
||
| render: text | ||
| validations: | ||
| required: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ## What changed | ||
|
|
||
| ## Why | ||
|
|
||
| ## Tests run | ||
|
|
||
| - [ ] `just check` and `just test` | ||
| - [ ] `just lint` | ||
| - [ ] live boot or `just e2e` (required for a change under `internal/core`, `internal/sshx`, `internal/cloudinit`, `internal/apkovl`, or a bundled recipe; paste the output below) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Include guest and boot-path changes in the live-boot requirement.
🤖 Prompt for AI Agents |
||
|
|
||
| ## OS matrix | ||
|
|
||
| Only for a recipe or guest change. One line per guest OS tested: `alpine: ok`, `debian: not tested`. | ||
|
|
||
| ## Docs | ||
|
|
||
| - [ ] `docs/` updated, or no user-visible change | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: gomod | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
|
Comment on lines
+7
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- .github/dependabot.yml ---'
cat -n .github/dependabot.yml
printf '%s\n' '--- Python manifests under mcp ---'
find mcp -maxdepth 2 -type f \( -name 'pyproject.toml' -o -name 'requirements*.txt' -o -name 'setup.py' -o -name 'setup.cfg' -o -name 'Pipfile' -o -name 'uv.lock' \) -print
printf '%s\n' '--- CI references to the MCP Python project ---'
rg -n -C 3 "uv pip install|mcp/\[\.[^]]*dev|directory:.*mcp|pyproject\.toml|requirements" .github mcp 2>/dev/null || trueRepository: NovusEdge/stoat Length of output: 1430 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- mcp/pyproject.toml ---'
cat -n mcp/pyproject.toml
printf '%s\n' '--- Dependabot-related repository guidance ---'
rg -n -i -C 2 "dependabot|renovate|dependency update|uv.lock|pip" README.md .github mcp 2>/dev/null || trueRepository: NovusEdge/stoat Length of output: 2197 Cover the MCP Python dependencies in Dependabot. The CI job installs dependencies from 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,8 @@ | |
| name: check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| - uses: actions/checkout@v6 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
sed -n '1,95p' .github/workflows/ci.ymlRepository: NovusEdge/stoat Length of output: 2688 🌐 Web query:
💡 Result: In version 6 of the actions/checkout GitHub Action, the default value for the persist-credentials input is true [1][2]. When persist-credentials is set to true (the default), the action configures the Git repository with the authentication token or SSH key, which allows subsequent steps in your workflow to run authenticated Git commands (such as git fetch or git push) without additional configuration [2][3]. In version 6, security for this feature was improved: credentials are now stored in a separate file under $RUNNER_TEMP rather than directly in the local.git/config file [2][4]. The token is removed during post-job cleanup [2]. If you do not require these credentials for your workflow steps, you can opt-out by explicitly setting persist-credentials to false in your workflow file [2][3]. Citations:
🌐 Web query:
💡 Result: In actions/checkout v6, the persist-credentials input, which defaults to true, has been updated to improve credential security by storing Git credentials in a separate configuration file under the runner's temporary directory ($RUNNER_TEMP) rather than directly in the repository's.git/config file [1][2][3]. This mechanism uses Git's includeIf functionality to conditionally include the credentials file when Git operates within the repository's directory [4][5]. This change is intended to isolate sensitive tokens and reduce the risk of credential leakage, such as in scenarios involving artifact publishing or accidental exposure of the.git directory [6]. However, this implementation has introduced several technical considerations for users: 1. Security and Trust: While v6 improves how credentials are stored, the persist-credentials=true setting remains a consideration for untrusted code [1]. When using workflows that check out code from forks (e.g., in pull_request_target scenarios), extra caution is required to prevent "pwn request" vulnerabilities [1]. In such untrusted contexts, setting persist-credentials: false is often recommended to opt out of automatic credential persistence [1][3]. 2. Docker Container Actions: A known limitation exists where the credentials file stored in $RUNNER_TEMP may not be accessible inside Docker container actions, causing Git authentication to fail [7]. This issue persists even with updated runners, as the container environment may not have the necessary path mappings or visibility into $RUNNER_TEMP [7]. 3. Self-Hosted Runners and Worktrees: Because the includeIf directive relies on specific paths (such as /github/workspace/), it may be incompatible with non-GitHub platforms or custom environments where those paths do not exist [4]. Additionally, the use of Git worktrees can lead to authentication failures because the path-based includeIf condition may not match the worktree's location, although updates in newer patch versions have aimed to address some of these edge cases [5]. For high-security workflows or environments where these compatibility issues arise, you can disable the behavior by setting persist-credentials: false in your workflow step and manually configuring authentication if needed [1][3]. Citations:
🏁 Script executed: #!/bin/bash
curl -fsSL https://raw.githubusercontent.com/actions/checkout/v6/action.yml | sed -n '1,140p'
printf '\n--- credential handling references ---\n'
curl -fsSL https://raw.githubusercontent.com/actions/checkout/v6/src/git-auth-helper.ts | rg -n -C 4 'RUNNER_TEMP|persistCredentials|extraheader|config'Repository: NovusEdge/stoat Length of output: 23373 Sensitive Data Exposure (CWE-522): Insufficiently Protected Credentials Reachability: External · Exploitability: Moderate Disable credential persistence on every checkout.
🧰 Tools🪛 zizmor (1.29.0)[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [warning] 1-85: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 11-36: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| - uses: actions/setup-go@v6 | ||
|
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
sed -n '1,90p' .github/workflows/ci.ymlRepository: NovusEdge/stoat Length of output: 2688 🏁 Script executed: #!/bin/bash
printf '%s\n' '--- workflow ---'
sed -n '1,90p' .github/workflows/ci.yml
printf '%s\n' '--- action references ---'
rg -n 'uses:' .github/workflows/ci.ymlRepository: NovusEdge/stoat Length of output: 3083 Security Misconfiguration (CWE-829): Inclusion of Functionality from Untrusted Control Sphere Reachability: External · Exploitability: Difficult Pin all changed actions to immutable commit SHAs. The 🧰 Tools🪛 zizmor (1.29.0)[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [warning] 1-85: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 11-36: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 16-16: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| with: | ||
| go-version: '1.26' | ||
|
|
||
|
|
@@ -35,20 +35,44 @@ | |
| - name: test | ||
| run: go test ./... | ||
|
|
||
| lint: | ||
| name: lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| - uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| version: v2.13.2 | ||
|
|
||
| shellcheck: | ||
|
Comment on lines
+39
to
+50
|
||
| name: shellcheck | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: install | ||
| run: sudo apt-get update -q && sudo apt-get install -y -q shellcheck | ||
| # Warning level: an info-level note about a quoted variable in a | ||
| # bundled installer is not worth a red PR. | ||
| - name: shellcheck | ||
| run: shellcheck -S warning $(git ls-files 'internal/recipes/bundled/*.sh' 'internal/recipes/bundled/*/*.sh' 'scripts/*.sh' '.githooks/*') | ||
|
|
||
|
Comment on lines
+38
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: sed -n '1,90p' .github/workflows/ci.ymlRepository: NovusEdge/stoat Length of output: 2688 Security Misconfiguration (CWE-732): Incorrect Permission Assignment for Critical Resource Reachability: External Set workflow-level permissions to 🧰 Tools🪛 actionlint (1.7.12)[error] 60-60: shellcheck reported issue in this script: SC2046:warning:1:23: Quote this to prevent word splitting (shellcheck) 🪛 GitHub Check: CodeQL[warning] 39-50: Workflow does not contain permissions [warning] 51-68: Workflow does not contain permissions 🪛 zizmor (1.29.0)[warning] 42-42: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [warning] 54-54: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [warning] 1-85: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 38-48: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 50-67: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [error] 42-42: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 43-43: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 46-46: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 54-54: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
| # A separate job because it needs Python rather than Go, and because a | ||
| # failure here should read as "the MCP server broke", not "the Go suite | ||
| # broke". Until this existed, mcp/'s tests ran only on a contributor's | ||
| # machine, so a regression in guards.py (the deterministic blocks that are | ||
| # the whole security boundary, since MCP guarantees nothing itself) would | ||
| # have merged green. | ||
| mcp: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| name: mcp | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: mcp | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: e2e | ||
|
|
||
| # Manual only. scripts/e2e.sh boots a real KVM VM and takes ~15 minutes; | ||
| # no hosted runner has /dev/kvm, so this runs on a self-hosted runner with | ||
| # the `kvm` label. It is the gate for the needs-live-boot label. | ||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: e2e | ||
| runs-on: [self-hosted, linux, kvm] | ||
| timeout-minutes: 40 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: printf '%s\n' '--- .github/workflows/e2e.yml ---'
cat -n .github/workflows/e2e.yml
printf '%s\n' '--- e2e script references ---'
rg -n -C 3 'e2e\.sh|git|GITHUB_TOKEN|github' scripts .github/workflows 2>/dev/nullRepository: NovusEdge/stoat Length of output: 2764 🏁 Script executed: printf '%s\n' '--- scripts/e2e.sh ---'
cat -n scripts/e2e.sh
printf '%s\n' '--- workflow-dispatch and checkout configuration ---'
rg -n -C 3 'workflow_dispatch|actions/checkout|persist-credentials|GITHUB_TOKEN|github\.token|token:' .github scriptsRepository: NovusEdge/stoat Length of output: 6075 Sensitive Data Exposure (CWE-922) Reachability: External · Exploitability: Moderate Disable checkout credential persistence.
🧰 Tools🪛 GitHub Check: CodeQL[warning] 11-24: Workflow does not contain permissions 🪛 zizmor (1.29.0)[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [warning] 1-25: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 10-25: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| - uses: actions/setup-go@v6 | ||
|
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
sed -n '1,45p' .github/workflows/e2e.ymlRepository: NovusEdge/stoat Length of output: 795 Security Misconfiguration (CWE-494): Download of Code Without Integrity Check Reachability: External · Exploitability: Difficult Pin the action references to immutable commits.
🧰 Tools🪛 GitHub Check: CodeQL[warning] 11-24: Workflow does not contain permissions 🪛 zizmor (1.29.0)[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [warning] 1-25: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 10-25: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 16-16: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| with: | ||
| go-version: '1.26' | ||
| - name: kvm | ||
| run: test -r /dev/kvm && test -w /dev/kvm | ||
| - name: e2e | ||
| env: | ||
| STOAT_HOME: ${{ runner.temp }}/stoat-e2e | ||
| run: ./scripts/e2e.sh | ||
|
Comment on lines
+11
to
+24
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: "2" | ||
| linters: | ||
| enable: | ||
| - errcheck | ||
| - staticcheck | ||
| - govet | ||
| - unused | ||
| - misspell | ||
| settings: | ||
| errcheck: | ||
| # A CLI cannot act on a failed write to its own stdout or stderr. The | ||
| # exclusion keeps every print site free of a two-token discard. | ||
| exclude-functions: | ||
| - fmt.Fprint | ||
| - fmt.Fprintf | ||
| - fmt.Fprintln | ||
|
Comment on lines
+13
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
printf '%s\n' '--- .golangci.yml ---'
cat -n .golangci.yml | sed -n '1,35p'
printf '%s\n' '--- fmt print call sites ---'
rg -n --glob '*.go' '\bfmt\.(Fprint|Fprintf|Fprintln)\s*\(' .Repository: NovusEdge/stoat Length of output: 13588 🌐 Web query:
💡 Result: In golangci-lint, you can exclude specific functions from errcheck analysis by using the Citations:
🏁 Script executed: #!/bin/bash
printf '%s\n' '--- CLI writer bindings ---'
rg -n -C 3 '\b(stdout|stderr)\b\s*(=|:|io\.Writer|os\.)|type .*CLI|struct \{' internal/cli
printf '%s\n' '--- non-CLI writer bindings ---'
sed -n '35,65p' internal/cloudinit/scripts.go
sed -n '125,150p' internal/cloudinit/cloudinit.go
sed -n '55,75p' internal/qemu/sendkey.go
sed -n '195,210p' internal/qemu/run.go
sed -n '220,245p' internal/sshx/sshx.goRepository: NovusEdge/stoat Length of output: 41855 Scope The global entries also suppress errors from QEMU connections, files, cloud-init builders, and log writers. CLI functions receive generic 🤖 Prompt for AI Agents |
||
| staticcheck: | ||
| # ST and QF rewrite working code for taste. QF1001 turned an allowlist | ||
| # test into its De Morgan form and broke the comment above it. | ||
| checks: ["all", "-ST*", "-QF*"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
|
|
||
| # Contributor Covenant Code of Conduct | ||
|
|
||
| ## Our Pledge | ||
|
|
||
| We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. | ||
|
|
||
| We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. | ||
|
|
||
| ## Our Standards | ||
|
|
||
| Examples of behavior that contributes to a positive environment for our community include: | ||
|
|
||
| * Demonstrating empathy and kindness toward other people | ||
| * Being respectful of differing opinions, viewpoints, and experiences | ||
| * Giving and gracefully accepting constructive feedback | ||
| * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience | ||
| * Focusing on what is best not just for us as individuals, but for the overall community | ||
|
|
||
| Examples of unacceptable behavior include: | ||
|
|
||
| * The use of sexualized language or imagery, and sexual attention or advances of any kind | ||
| * Trolling, insulting or derogatory comments, and personal or political attacks | ||
| * Public or private harassment | ||
| * Publishing others' private information, such as a physical or email address, without their explicit permission | ||
| * Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
|
||
| ## Enforcement Responsibilities | ||
|
|
||
| Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. | ||
|
|
||
| Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. | ||
|
|
||
| ## Scope | ||
|
|
||
| This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. | ||
|
|
||
| ## Enforcement | ||
|
|
||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at a private security advisory at https://github.com/NovusEdge/stoat/security/advisories/new, or an email to the maintainer listed on the GitHub profile. All complaints will be reviewed and investigated promptly and fairly. | ||
|
|
||
| All community leaders are obligated to respect the privacy and security of the reporter of any incident. | ||
|
|
||
| ## Enforcement Guidelines | ||
|
|
||
| Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: | ||
|
|
||
| ### 1. Correction | ||
|
|
||
| **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. | ||
|
|
||
| **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. | ||
|
|
||
| ### 2. Warning | ||
|
|
||
| **Community Impact**: A violation through a single incident or series of actions. | ||
|
|
||
| **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. | ||
|
|
||
| ### 3. Temporary Ban | ||
|
|
||
| **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. | ||
|
|
||
| **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. | ||
|
|
||
| ### 4. Permanent Ban | ||
|
|
||
| **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. | ||
|
|
||
| **Consequence**: A permanent ban from any sort of public interaction within the community. | ||
|
|
||
| ## Attribution | ||
|
|
||
| This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
|
||
| Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. | ||
|
|
||
| For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. | ||
|
|
||
| [homepage]: https://www.contributor-covenant.org | ||
| [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
| [Mozilla CoC]: https://github.com/mozilla/diversity | ||
| [FAQ]: https://www.contributor-covenant.org/faq | ||
| [translations]: https://www.contributor-covenant.org/translations | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,21 +4,22 @@ | |
|
|
||
| ```sh | ||
| just setup # builds, installs to ~/.local/bin, reports missing host deps | ||
| just hooks # installs the pre-commit and commit-msg hooks | ||
| just dev # runs the TUI against a scratch STOAT_HOME | ||
| ``` | ||
|
|
||
| `just setup` also installs the git hooks. | ||
|
|
||
| Go 1.26 (pinned in `go.mod`), `just`, and for anything that boots a VM: | ||
| KVM, `qemu-system-x86_64`, `qemu-img`, `ssh`. `stoat doctor` lists what is | ||
| missing. | ||
| missing. `just lint` also needs `golangci-lint` v2 and `shellcheck`. | ||
|
|
||
| ## Branches and pull requests | ||
|
|
||
| - Branch off `main`. One change per branch. | ||
| - Every PR is squash merged. The PR title becomes the commit subject, so | ||
| write it in the commit grammar below. | ||
| - Sign off every commit (`git commit -s`). The DCO check reads the | ||
| `Signed-off-by` trailer. | ||
| - Sign off every commit (`git commit -s`). The DCO check on the PR reads | ||
| the `Signed-off-by` trailer and blocks a merge without it. | ||
|
Comment on lines
+21
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial ✅ Runtime observed🏁 Script executed: #!/bin/bash
printf '%s\n' '--- CONTRIBUTING.md ---'
sed -n '1,70p' CONTRIBUTING.md
printf '%s\n' '--- workflow/config references to DCO ---'
rg -n -i --glob '.github/**' --glob '*.yml' --glob '*.yaml' --glob '*.md' --glob 'CODEOWNERS' 'dco|signed-off-by|signoff|status.?check|branch protection' . || true
printf '%s\n' '--- repository files relevant to CI/policy ---'
git ls-files '.github' 'CONTRIBUTING.md' 'README.md' | sed -n '1,160p'Repository: NovusEdge/stoat Length of output: 5214 🌐 Web query:
💡 Result: No direct indexed results were found for The query concerns GitHub’s DCO requirement: contributors add a 🏁 Script executed: #!/bin/bash
set -o pipefail
printf '%s\n' '--- main branch protection ---'
curl -sS -L -H 'Accept: application/vnd.github+json' \
https://api.github.com/repos/NovusEdge/stoat/branches/main/protection | \
python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps(d, indent=2, sort_keys=True))'
printf '%s\n' '--- open pull requests and check contexts ---'
curl -sS -L -H 'Accept: application/vnd.github+json' \
'https://api.github.com/repos/NovusEdge/stoat/pulls?state=open&per_page=10' | \
python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps([{"number":p.get("number"),"title":p.get("title"),"head_sha":p.get("head",{}).get("sha")} for p in d], indent=2))'Repository: NovusEdge/stoat Length of output: 1795 🏁 Script executed: #!/bin/bash
set -o pipefail
sha='fbb5e229c3817f4530ef09e2ad0c5c72b8614c93'
printf '%s\n' '--- commit statuses ---'
curl -sS -L -H 'Accept: application/vnd.github+json' \
"https://api.github.com/repos/NovusEdge/stoat/commits/$sha/status" | \
python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({"state":d.get("state"),"statuses":[{"context":x.get("context"),"state":x.get("state"),"creator":x.get("creator",{}).get("login")} for x in d.get("statuses",[])]}, indent=2))'
printf '%s\n' '--- check runs ---'
curl -sS -L -H 'Accept: application/vnd.github+json' \
"https://api.github.com/repos/NovusEdge/stoat/commits/$sha/check-runs" | \
python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({"total_count":d.get("total_count"),"check_runs":[{"name":x.get("name"),"status":x.get("status"),"conclusion":x.get("conclusion"),"app":x.get("app",{}).get("slug")} for x in d.get("check_runs",[])]}, indent=2))'Repository: NovusEdge/stoat Length of output: 927 Confirm the DCO merge gate before merge. An open PR has no 🤖 Prompt for AI Agents |
||
| - No `Co-Authored-By` or tool-attribution trailers. The `commit-msg` hook | ||
| strips them. | ||
| - A PR that changes a bundled recipe, a guest, or the boot path gets the | ||
|
|
@@ -38,7 +39,9 @@ was found. | |
| ## Gates | ||
|
|
||
| `just check` runs gofmt, `go vet`, and `go build`. The pre-commit hook | ||
| runs the same. CI runs those plus `go test ./...` on every PR. | ||
| runs the same. `just lint` runs golangci-lint and shellcheck. CI runs | ||
| all of those plus `go test ./...` on every PR. The DCO app checks the | ||
| sign-off trailer on every commit in a PR. | ||
|
|
||
| ## Tests | ||
|
|
||
|
|
@@ -74,6 +77,11 @@ A change to a subsystem or an interface another package depends on | |
| starts as an issue that states the design, discussed before the | ||
| implementation PR. Settled decisions go in `docs/design/`. | ||
|
|
||
| `docs/design/core-api.md` §12 holds the conventions a new CLI command | ||
| follows: the `wire` struct behind `--json`, `fail` against `failMsg`, the | ||
| shared `confirm` helper, kong aliases, and `tomlx` for a TOML file. A | ||
| reviewer rejects a PR that ignores them. | ||
|
|
||
| ## Recipes | ||
|
|
||
| Bundled recipes are `xfce`, `docker`, `devtools`, `tailscale`, and the set | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: NovusEdge/stoat
Length of output: 14639
🏁 Script executed:
Repository: NovusEdge/stoat
Length of output: 16893
🏁 Script executed:
Repository: NovusEdge/stoat
Length of output: 9654
🏁 Script executed:
Repository: NovusEdge/stoat
Length of output: 21754
Sensitive Data Exposure (CWE-532): Insertion of Sensitive Information into Log File
Reachability: External · Exploitability: Trivial
Add redaction guidance for public diagnostics.
last-provision.logrecords both stdout and stderr from remote recipe commands. It can contain credentials, tokens, private paths, host identifiers, or personal data. Add an explicit warning to redact sensitive data before submittingstoat doctoror log output.🤖 Prompt for AI Agents