Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
10 changes: 5 additions & 5 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# real vulnerabilities fail the job.
[advisories]
ignore = [
# Marvin attack advisory covers every released version of rsa (introduced 0.0.0-0, no patch).
# sharecli only decodes/verifies JWTs with RSA public keys for local sidecar auth (src/serve_auth.rs).
"RUSTSEC-2023-0071",
# Informational 'unmaintained' advisory for paste - stale Cargo.lock entry.
"RUSTSEC-2024-0436",
# Marvin attack advisory covers every released version of rsa (introduced 0.0.0-0, no patch).
# sharecli only decodes/verifies JWTs with RSA public keys for local sidecar auth (src/serve_auth.rs).
"RUSTSEC-2023-0071",
# Informational 'unmaintained' advisory for paste - stale Cargo.lock entry.
"RUSTSEC-2024-0436",
]
11 changes: 2 additions & 9 deletions .cargo/mutants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@
# Threshold contract: docs/ops/mutants-threshold.md
# Schema: cargo-mutants ≥25 (examine_globs + exclude_re; no jobs/timeout keys)

examine_globs = [
"crates/sharecli-thermal-tui/src/lib.rs",
]
examine_globs = ["crates/sharecli-thermal-tui/src/lib.rs"]

exclude_re = [
"render",
"event_loop",
"replace run ",
"count_cargo_builds",
]
exclude_re = ["render", "event_loop", "replace run ", "count_cargo_builds"]

test_package = ["sharecli-thermal-tui"]
14 changes: 14 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# actionlint configuration
# https://github.com/rhysd/actionlint/blob/v1.7.12/docs/config.md
# Note: the repository self-hosts no runners; all workflows run on GitHub-hosted
# images, so no self-hosted-runner labels are declared here.

paths:
# Forward reference: the `detect` job's `outputs:` block references
# `steps.detect.outputs.*` before the step with `id: detect` is declared.
# This is legal in GitHub Actions (step ids resolve within the whole job) and
# the detect job is exercised on every CI run, but actionlint's static
# analysis reports it as an undefined property. Ignore that specific message.
.github/workflows/ci.yml:
ignore:
- 'property "detect" is not defined in object type'
4 changes: 2 additions & 2 deletions .github/workflows/a11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '20'
node-version: '22'
cache: npm

- name: Install a11y deps
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Build sharecli
run: cargo build --locked --release -p sharecli
- name: Install Playwright Chromium
run: npx --yes playwright@1.49.0 install --with-deps chromium
run: npx --yes playwright@1.62.1 install --with-deps chromium
- name: Run keyboard Tab-cycle
env:
SHARECLI_VISUAL_FIXTURE: "1"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ jobs:
"go:${{ needs.go.result }}" \
"typescript:${{ needs.typescript.result }}" \
"security:${{ needs.security.result }}" \
"dep-review:${{ needs.dependency-review.result }}" \
"dep-review:${{ needs.dep-review.result }}" \
; do
name="${pair%%:*}"
result="${pair#*:}"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/fuse-mount-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29
with:
version: 0.14.1
- name: Install fuse3
run: sudo apt-get update && sudo apt-get install -y fuse3 libfuse3-dev pkg-config
- name: Privileged mount smoke
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/infisical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
sync-secrets:
name: Pull secrets from Infisical
runs-on: blacksmith-2vcpu-ubuntu-2204
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:
with:
name: infisical-debug
path: .env
retention-days: 1
retention-days: 1
7 changes: 6 additions & 1 deletion .github/workflows/sast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ on:
branches: [main, develop]
pull_request:
schedule: [{cron: "0 2 * * *"}]
permissions:
contents: read
security-events: write
jobs:
codeql:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

curl -fsSL \
  https://raw.githubusercontent.com/actions/checkout/3d3c42e5aac5ba805825da76410c181273ba90b1/action.yml \
  | rg -n -C2 'persist-credentials|default:'

Repository: KooshaPari/sharecli

Length of output: 3140


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf 'Workflow outline / relevant lines:\n'
sed -n '1,120p' .github/workflows/sast.yml

printf '\nAll checkout references in workflow:\n'
rg -n "actions/checkout|codeql|persist-credentials|permissions:" .github/workflows/sast.yml

Repository: KooshaPari/sharecli

Length of output: 1142


Disable persisted checkout credentials.

actions/checkout leaves GITHUB_TOKEN configured in the local git config by default, so the repository-controlled CodeQL autobuild step can run with that token available. Set persist-credentials: false.

Proposed fix
       - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.29.0)

[warning] 14-14: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sast.yml at line 14, Update the actions/checkout step to
set persist-credentials to false, ensuring checkout does not leave GITHUB_TOKEN
in the local git configuration before the CodeQL autobuild step runs.

- uses: github/codeql-action/init@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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

git ls-remote https://github.com/github/codeql-action.git \
  'refs/tags/v4' 'refs/tags/v4^{}'

Repository: KooshaPari/sharecli

Length of output: 268


🌐 Web query:

github/codeql-action GitHub Actions v4 commit tag

💡 Result:

The GitHub CodeQL Action v4 is the current, recommended major version of the action [1][2][3]. GitHub advises users to reference the CodeQL Action using the major version tag, such as v4, in workflow files [1][2][3]. This practice ensures that workflows automatically receive the latest releases, bug fixes, features, and updated CodeQL CLI versions within that major version [1][2][3]. As of August 9, 2026, the latest releases within the v4 series include versions such as v4.37.4 [4][5]. The CodeQL Action v4 was introduced on October 7, 2025, and runs on the Node.js 24 runtime [6]. To use the action in your GitHub Actions workflow, you would reference it as follows [7]: - uses: github/codeql-action/init@v4 - uses: github/codeql-action/analyze@v4 Major version tags like v4 act as moving targets that point to the most recent release within that branch, allowing for automatic updates without manual intervention [1][2][3]. Detailed information on specific changes and version history can be found on the official GitHub CodeQL Action releases page [4][5].

Citations:


Pin the CodeQL init action to an immutable commit.

github/codeql-action/init@v4 is a moving tag and can be updated after review. Replace it with the intended release commit ID.

🧰 Tools
🪛 zizmor (1.29.0)

[error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sast.yml at line 15, Update the CodeQL action reference in
the workflow’s init step from the mutable v4 tag to the intended immutable
release commit ID, preserving the existing github/codeql-action/init step.

Source: Linters/SAST tools

with:
languages: typescript, python, rust, go
# Go was removed: the repo contains no Go sources, and CodeQL aborts
# database finalization when a configured language has no files.
languages: typescript, python, rust
- uses: github/codeql-action/autobuild@v4
- uses: github/codeql-action/analyze@v4
7 changes: 6 additions & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ on:
push:
branches: [main]

permissions: read-all
permissions:
contents: read
# Required by scorecard-action's `publish_results` (Fulcio signing via OIDC);
# `read-all` (previous value) blocked the token and failed the run with
# "error obtaining token: expired_token" during result signing.
id-token: write
Comment on lines +18 to +23

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C3 'permissions:|security-events|upload-sarif|sarif_file' \
  .github/workflows/scorecard.yml

Repository: KooshaPari/sharecli

Length of output: 753


🌐 Web query:

github/codeql-action/upload-sarif required workflow permissions security-events write

💡 Result:

To use the github/codeql-action/upload-sarif action, your workflow job requires specific permissions granted to the GITHUB_TOKEN. While security-events: write is the fundamental permission for uploading analysis results, technical requirements for the action have evolved to include additional access for certain environments [1][2]. The required permissions are: 1. security-events: write: This is mandatory for all workflows to allow the action to upload SARIF results to GitHub Code Scanning [3][4][5]. 2. contents: read: This is required for workflows running in private repositories [3][4][5]. 3. actions: read: This is required, particularly in private repositories, because the action needs to query workflow run metadata to function correctly [1][2]. Failure to include this may result in a "Resource not accessible by integration" error [6][2]. For a typical workflow job in a private repository, you should configure the permissions block as follows [3][4]: permissions: security-events: write actions: read contents: read If you do not explicitly define these permissions in your workflow file, the GITHUB_TOKEN may default to a set of permissions that lacks the necessary access, leading to integration errors [6][2]. Always define these at the job level to ensure the action operates with the required privileges [6][2].

Citations:


Grant the SARIF upload permission.

This workflow uploads results.sarif with github/codeql-action/upload-sarif, which requires security-events: write on the job token. Add that permission to the explicit permissions block.

Proposed fix
 permissions:
   contents: read
+  security-events: write
   # Required by scorecard-action's `publish_results` (Fulcio signing via OIDC);
   id-token: write
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: read
# Required by scorecard-action's `publish_results` (Fulcio signing via OIDC);
# `read-all` (previous value) blocked the token and failed the run with
# "error obtaining token: expired_token" during result signing.
id-token: write
permissions:
contents: read
security-events: write
# Required by scorecard-action's `publish_results` (Fulcio signing via OIDC);
# `read-all` (previous value) blocked the token and failed the run with
# "error obtaining token: expired_token" during result signing.
id-token: write
🧰 Tools
🪛 zizmor (1.29.0)

[error] 23-23: overly broad permissions (excessive-permissions): id-token: write is overly broad at the workflow level

(excessive-permissions)


[warning] 23-23: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/scorecard.yml around lines 18 - 23, Add security-events:
write to the explicit permissions block in the scorecard workflow so the
github/codeql-action/upload-sarif step can upload results.sarif, while
preserving the existing contents and id-token permissions.


jobs:
analysis:
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1


- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Zig
Expand All @@ -72,8 +72,6 @@ jobs:
with:
file: Cargo.lock



# Dependency Vulnerability Scanning
dependencies:
name: Dependency Audit
Expand All @@ -82,7 +80,7 @@ jobs:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1


- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

Expand All @@ -91,8 +89,6 @@ jobs:
cargo install cargo-audit
cargo audit



# Container Scanning (if Dockerfile exists)
container:
name: Container Scan
Expand Down
35 changes: 35 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Yamllint configuration used by Trunk Check (docs: https://yamllint.readthedocs.io/)
# Relaxations vs yamllint defaults:
# - line-length: the repo's workflows/docs carry long URLs and expressions
# (GitHub `${{ }}` interpolations, SHA-pinned action refs). Enforced for
# `.md`-free YAML would generate noise; disabled repo-wide.
# - comments: hash comments (e.g. `# v7.0.1` next to pinned actions) may be
# indented freely; only require a space after the hash.
# - document-start: workflows start with `name:` and no `---`; not required.
# - truthy: `on:` is parsed as a boolean key by some YAML 1.1 parsers.
# Allowed explicitly to keep `on:`-based workflow triggers clean.

extends: default

rules:
line-length: disable
comments:
require-starting-space: true
min-spaces-from-content: 1
comments-indentation: disable
document-start: disable
truthy:
allowed-values:
- "true"
- "false"
- "on"
- "off"
check-keys: false
brackets:
max-spaces-inside: 1
braces:
min-spaces-inside: 0
max-spaces-inside: 1
indentation:
spaces: consistent
indent-sequences: whatever
138 changes: 37 additions & 101 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,113 +1,49 @@
# =============================================================================
# Trunk.io — Plugin versions for linting/formatting tools
# Trunk.io — Unified linting/formatting in GitHub Actions

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Replace the Unicode em dash with ASCII punctuation.

Replace with -. As per coding guidelines, use UTF-8 text files and do not use Windows-1252 smart quotes or other special characters.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.trunk/trunk.yaml at line 2, Update the heading comment in trunk.yaml to
replace the Unicode em dash with an ASCII hyphen, leaving the rest of the
comment unchanged.

Source: Coding guidelines

# =============================================================================
# This file is auto-generated. Run `trunk upgrade` to update.
# https://docs.trunk.io/check/reference
# Schema: https://docs.trunk.io/check/reference
#
# Scope note: this lane is deliberately lean. The repo's heavier quality gates
# already run as dedicated workflows (cargo fmt + clippy in security.yml /
# ci-gate.yml, cargo test in the release matrix), and the nested lib/teamcomm
# workspace is not formatted by the root `cargo fmt` (40+ files). This lane
# lints the things no other lane covers: workflow YAML (actionlint), TOML
# formatting (taplo), and YAML style (yamllint, relaxed via
# .trunk/configs/.yamllint.yaml).
# =============================================================================
version: 0.1

plugins:
sources:
- id: trunk
ref: v1.2.2
- id: community
ref: main
uri: https://github.com/trunk-io/plugins
ref: v1.6.7

# Linters (auto-detected by file type)
linters:
actionlint:
enabled: true
commands:
- name: actionlint
run: actionlint ${target}
direct_configs:
- .github/workflows/*.yml
black:
enabled: true
commands:
- name: black
run: black --check --line-length 100 ${target}
direct_configs:
- pyproject.toml
- ruff.toml
clippy:
enabled: true
commands:
- name: clippy
run: cargo clippy --all-targets --all-features -- -D warnings
eslint:
enabled: true
direct_configs:
- .eslintrc.*
- eslint.config.*
golangci-lint:
enabled: true
direct_configs:
- .golangci.yml
- .golangci.yaml
mypy:
enabled: true
commands:
- name: mypy
run: mypy --ignore-missing-imports ${target}
ruff:
enabled: true
commands:
- name: ruff
run: ruff check --output-format=github ${target}
direct_configs:
- ruff.toml
- pyproject.toml
shellcheck:
enabled: true
taplo:
enabled: true
yamllint:
enabled: true
cli:
version: 1.22.2

# Formatters
formatters:
black:
enabled: true
commands:
- name: black
run: black --line-length 100 ${target}
direct_configs:
- pyproject.toml
prettier:
enabled: true
direct_configs:
- .prettierrc
- prettier.config.*
rustfmt:
enabled: true
commands:
- name: rustfmt
run: rustfmt ${target}
lint:
enabled:
- actionlint
- taplo
- yamllint
disabled: []
# The `detect` job's `outputs:` block references `steps.detect.outputs.*`
# before the step with `id: detect` is declared. This is legal in GitHub
# Actions (step ids resolve within the whole job; the detect job runs on
# every CI run), but actionlint's static analysis reports it as an undefined
# property. Ignore that specific message in ci.yml only.
ignore:
- linters: [actionlint]
paths:
- .github/workflows/ci.yml

Comment on lines +31 to 40

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' 'Trunk suppression:'
sed -n '25,42p' .trunk/trunk.yaml

printf '%s\n' 'Message-specific actionlint suppression:'
sed -n '6,15p' .github/actionlint.yaml

Repository: KooshaPari/sharecli

Length of output: 1251


Remove the broad Trunk actionlint suppression.

.trunk/trunk.yaml ignores all actionlint diagnostics in .github/workflows/ci.yml, while .github/actionlint.yaml already provides the narrower suppression for the undefined steps.detect.outputs.* message. Drop the Trunk ignore block so the workflow is linted for unrelated actionlint problems.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.trunk/trunk.yaml around lines 31 - 40, Remove the Trunk-level actionlint
ignore block from .trunk/trunk.yaml, including its ci.yml path restriction.
Preserve the narrower suppression already configured in .github/actionlint.yaml
so unrelated actionlint diagnostics in ci.yml remain enabled.

# Actions (CI optimization)
actions:
trunk-check:
enabled: true
size: 5GB
memory: 16GB
disk: 10GB
trunk-merge:
enabled: true
size: 5GB
trunk-push:
enabled: true
size: 5GB

# Caching
cache:
enabled: true
storage: local

# CLI
cli:
version: 1.22.2
enabled: []
disabled:
- trunk-announce
- trunk-cache-prune
- trunk-upgrade-available

# Environment
env:
variables:
EDITOR: vim
tools:
enabled: []
Loading
Loading