-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add Kilo Gastown methodology spec and SAST tooling #942
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 11 commits
0f98bcc
3d28883
f44d1fd
fa9c9d5
07c09bc
faafc4f
52b6035
b460bab
576b830
eac2d7f
d530d80
39ba5a3
d9cff8a
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,52 @@ | ||
| # cliproxyapi-plusplus Ruleset Baseline | ||
|
|
||
| Version: 2026-04-02 | ||
| Ruleset JSON: `.github/rulesets/main.json` | ||
|
|
||
| ## Changelog | ||
|
|
||
| - 2026-04-02: aligned the checked-in baseline with the repo-local governance wave, safer workflow pins, and the next required-check manifest pass. | ||
|
|
||
| This repository now has a checked-in baseline that matches the repaired remote `Main` ruleset. | ||
|
|
||
| ## Enforced Branch Protection Baseline | ||
|
|
||
| - require pull requests before merge on the default branch | ||
| - no branch deletion | ||
| - no force push / non-fast-forward updates | ||
| - require at least 1 approval | ||
| - dismiss stale approvals on new push | ||
| - require code owner review | ||
| - require last push approval before merge | ||
| - require resolved review threads before merge | ||
| - allow merge methods: `merge`, `squash` | ||
| - enable GitHub `copilot_code_review` | ||
|
|
||
| ## Repo-Local Governance Gates | ||
|
|
||
| The repo-local workflow set remains the main CI and policy contract: | ||
|
|
||
| - `policy-gate` | ||
| - `pr-path-guard` | ||
| - `pr-test-build` | ||
| - `required-check-names-guard` | ||
| - `quality-gate` | ||
| - `security-guard` | ||
| - `codeql` | ||
| - `sast-quick` | ||
| - `sast-full` | ||
|
|
||
| Current required check manifests: | ||
|
|
||
| - `.github/required-checks.txt` | ||
| - `.github/release-required-checks.txt` | ||
| - `.github/rulesets/main.json` | ||
|
|
||
| Those manifests should drive the next remote ruleset wave once the stable job names are re-verified | ||
| against live workflow output. | ||
|
|
||
| ## Exception Policy | ||
|
|
||
| - only documented billing or quota failures may be excluded from blocking CI evaluation | ||
| - review threads and blocking comments must be resolved before merge | ||
| - PRs must not rely on local `--no-verify` bypasses instead of server-side checks | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,13 @@ | ||||||||||||||||||
| # workflow_file|job_name | ||||||||||||||||||
| policy-gate.yml|enforce | ||||||||||||||||||
| pr-path-guard.yml|ensure-no-translator-changes | ||||||||||||||||||
| quality-gate.yml|verify | ||||||||||||||||||
| required-check-names-guard.yml|verify-required-check-names | ||||||||||||||||||
| security-guard.yml|ggshield-scan | ||||||||||||||||||
| sast-quick.yml|semgrep | ||||||||||||||||||
| sast-quick.yml|secrets | ||||||||||||||||||
| sast-quick.yml|go-quality | ||||||||||||||||||
| sast-quick.yml|license-check | ||||||||||||||||||
|
Comment on lines
+7
to
+10
|
||||||||||||||||||
| sast-quick.yml|semgrep | |
| sast-quick.yml|secrets | |
| sast-quick.yml|go-quality | |
| sast-quick.yml|license-check | |
| sast-quick.yml|Semgrep Scan | |
| sast-quick.yml|Secret Scanning | |
| sast-quick.yml|Go Quality | |
| sast-quick.yml|License Check |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,3 +1,11 @@ | ||||||||||||||||||
| # workflow_file|job_name | ||||||||||||||||||
| pr-test-build.yml|build | ||||||||||||||||||
| policy-gate.yml|enforce | ||||||||||||||||||
| pr-path-guard.yml|ensure-no-translator-changes | ||||||||||||||||||
| pr-test-build.yml|build | ||||||||||||||||||
| quality-gate.yml|verify | ||||||||||||||||||
| required-check-names-guard.yml|verify-required-check-names | ||||||||||||||||||
| security-guard.yml|ggshield-scan | ||||||||||||||||||
| sast-quick.yml|semgrep | ||||||||||||||||||
| sast-quick.yml|secrets | ||||||||||||||||||
| sast-quick.yml|go-quality | ||||||||||||||||||
| sast-quick.yml|license-check | ||||||||||||||||||
|
Comment on lines
+8
to
+11
|
||||||||||||||||||
| sast-quick.yml|semgrep | |
| sast-quick.yml|secrets | |
| sast-quick.yml|go-quality | |
| sast-quick.yml|license-check | |
| sast-quick.yml|Semgrep Scan | |
| sast-quick.yml|Secret Scanning | |
| sast-quick.yml|Go Quality | |
| sast-quick.yml|License Check |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "Main", | ||
| "target": "branch", | ||
| "enforcement": "active", | ||
| "conditions": { | ||
| "ref_name": { | ||
| "include": ["~DEFAULT_BRANCH"], | ||
| "exclude": [] | ||
| } | ||
| }, | ||
| "bypass_actors": [], | ||
| "rules": [ | ||
| { "type": "deletion" }, | ||
| { "type": "non_fast_forward" }, | ||
| { | ||
| "type": "pull_request", | ||
| "parameters": { | ||
| "required_approving_review_count": 1, | ||
| "dismiss_stale_reviews_on_push": true, | ||
| "required_reviewers": [], | ||
| "require_code_owner_review": true, | ||
| "require_last_push_approval": true, | ||
| "required_review_thread_resolution": true, | ||
| "allowed_merge_methods": ["merge", "squash"] | ||
| } | ||
| }, | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| { | ||
| "type": "copilot_code_review", | ||
| "parameters": { | ||
| "review_on_push": true, | ||
| "review_draft_pull_requests": true | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,7 +12,8 @@ jobs: | |||||||||
| - name: Refresh models catalog | ||||||||||
| run: | | ||||||||||
| git fetch --depth 1 https://github.com/router-for-me/models.git main | ||||||||||
| git show FETCH_HEAD:models.json > internal/registry/models/models.json | ||||||||||
| mkdir -p pkg/llmproxy/registry/models | ||||||||||
| git show FETCH_HEAD:models.json > pkg/llmproxy/registry/models/models.json | ||||||||||
|
Comment on lines
14
to
+16
|
||||||||||
| mkdir -p pkg/llmproxy/registry/models | |
| git show FETCH_HEAD:models.json > pkg/llmproxy/registry/models/models.json | |
| mkdir -p pkg/llmproxy/registry/models internal/registry/models | |
| git show FETCH_HEAD:models.json | tee pkg/llmproxy/registry/models/models.json > internal/registry/models/models.json |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,92 @@ | ||||||||
| name: SAST Full Analysis | ||||||||
|
|
||||||||
| on: | ||||||||
| schedule: | ||||||||
| - cron: "0 2 * * *" | ||||||||
| workflow_dispatch: | ||||||||
|
|
||||||||
| permissions: | ||||||||
|
||||||||
| permissions: | |
| permissions: | |
| actions: read |
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.
WARNING: CodeQL matrix missing Go language.
The matrix lists [python, cpp, javascript] but this is primarily a Go codebase (per cargo clippy in sast-quick.yml, the AGENTS.md build instructions, and the codebase structure). Without go in the matrix, CodeQL will not analyze the core Go code, making the full SAST scan incomplete for this repository.
| - uses: actions/checkout@v4 | |
| language: [go, python, javascript] |
Note: also removed cpp since this doesn't appear to be a C++ project. Adjust if there is C++ code present.
Copilot
AI
Apr 2, 2026
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.
This workflow uses CodeQL action v3 (github/codeql-action/*@v3), but the existing .github/workflows/codeql.yml uses v4 (see .github/workflows/codeql.yml:24-36). Aligning on a single major version reduces maintenance overhead and avoids behavioral differences across workflows.
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.
WARNING: Using @master branch reference for trivy-action.
Pinning to a mutable branch (@master) introduces supply-chain risk and non-reproducible builds. If the upstream action is compromised or introduces breaking changes, your CI will silently adopt them.
Recommend pinning to a specific version tag or commit SHA:
- uses: aquasecurity/trivy-action@v0.28.0
Copilot
AI
Apr 2, 2026
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.
Same as in sast-quick: running Semgrep with --error will fail the scheduled full scan on any finding, including low-signal rules. If this workflow is intended to be informational (nightly signal) rather than gating, consider removing --error or filtering by severity / excluding the in-repo custom rules until noise is reduced.
| --error \ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| name: SAST Quick Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| jobs: | ||
| semgrep: | ||
| name: Semgrep Scan | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install Semgrep | ||
| run: python -m pip install --disable-pip-version-check semgrep==1.157.0 | ||
| - name: Run Semgrep | ||
| env: | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| PR_BASE_REF: ${{ github.event.pull_request.base.ref }} | ||
| HEAD_SHA: ${{ github.sha }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [ "$EVENT_NAME" = "pull_request" ]; then | ||
| git fetch --no-tags --depth=1 origin "$PR_BASE_REF" | ||
| mapfile -t changed_files < <( | ||
| git diff --name-only --diff-filter=ACMR "origin/$PR_BASE_REF...$HEAD_SHA" -- \ | ||
| '*.go' '*.yaml' '*.yml' '*.sh' '*.json' '*.ts' '*.tsx' '*.js' '*.jsx' | ||
| ) | ||
| if [ "${#changed_files[@]}" -eq 0 ]; then | ||
| cat > semgrep.sarif <<'EOF' | ||
| {"version":"2.1.0","runs":[]} | ||
| EOF | ||
| exit 0 | ||
| fi | ||
| semgrep scan \ | ||
| --config .semgrep-rules/ \ | ||
| --config p/security-audit \ | ||
| --config p/owasp-top-ten \ | ||
| --config p/cwe-top-25 \ | ||
| --error \ | ||
| --sarif \ | ||
| --output semgrep.sarif \ | ||
| "${changed_files[@]}" | ||
|
Comment on lines
+46
to
+54
|
||
| else | ||
| semgrep scan \ | ||
| --config .semgrep-rules/ \ | ||
| --config p/security-audit \ | ||
| --config p/owasp-top-ten \ | ||
| --config p/cwe-top-25 \ | ||
| --error \ | ||
| --sarif \ | ||
| --output semgrep.sarif \ | ||
| . | ||
| fi | ||
|
|
||
| - name: Upload SARIF | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| if: always() | ||
| with: | ||
| sarif_file: semgrep.sarif | ||
| category: semgrep | ||
|
|
||
| secrets: | ||
| name: Secret Scanning | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 3 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: trufflesecurity/trufflehog@v3.94.2 | ||
| with: | ||
| path: ./ | ||
| extra_args: --only-verified | ||
|
|
||
|
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. WARNING: Using Pinning to - uses: trufflesecurity/trufflehog@v3.82.12 |
||
| go-quality: | ||
| name: Go Quality | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| - name: Enforce gofmt | ||
| run: | | ||
| if ! git ls-files -z '*.go' | grep -q .; then | ||
| exit 0 | ||
| fi | ||
| unformatted=$( | ||
| git ls-files -z '*.go' | | ||
| xargs -0 gofmt -l | ||
| ) | ||
| if [ -n "$unformatted" ]; then | ||
| echo "$unformatted" | ||
| exit 1 | ||
| fi | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - name: Run go vet | ||
| run: go vet ./... | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| license-check: | ||
| name: License Compliance | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
| - name: Capture dependency inventory | ||
| run: | | ||
| go list -m -f '{{if not .Main}}{{.Path}} {{.Version}}{{end}}' all | sort > license-inventory.txt | ||
| test -s license-inventory.txt | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,23 @@ | ||||||||||||
| name: security-guard | ||||||||||||
| on: [workflow_dispatch] | ||||||||||||
| name: Security Guard | ||||||||||||
|
|
||||||||||||
| on: | ||||||||||||
| workflow_call: | ||||||||||||
|
||||||||||||
| workflow_call: | |
| workflow_call: | |
| secrets: | |
| GITGUARDIAN_API_KEY: | |
| required: true |
Copilot
AI
Apr 2, 2026
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.
This workflow is listed as a required check (security-guard.yml|ggshield-scan), but it only triggers via workflow_dispatch/workflow_call and is not invoked by any other workflow. As a result, PRs/branch updates won't automatically produce the required status check, potentially blocking merges unless run manually. Consider adding pull_request/push triggers (or wiring a caller workflow) or removing it from the required-check manifest if it should remain manual-only.
| workflow_dispatch: | |
| workflow_dispatch: | |
| push: | |
| pull_request: |
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.
🧩 Analysis chain
🏁 Script executed:
Repository: KooshaPari/cliproxyapi-plusplus
Length of output: 1151
Manifest files exist but are incomplete—most documented workflows are missing.
Both
.github/required-checks.txtand.github/release-required-checks.txtexist, but the manifest contents significantly diverge from the documented workflow names (lines 21-29). The manifests currently list onlypr-test-buildandpr-path-guard, while 7 documented workflows are absent:policy-gate,required-check-names-guard,quality-gate,security-guard,codeql,sast-quick, andsast-full. These manifests must be updated to align with the documented workflows before they can reliably drive the next ruleset wave.🤖 Prompt for AI Agents