Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0f98bcc
Add Kilo Gastown methodology spec
Mar 31, 2026
3d28883
docs: resolve merge conflict in KILO_GASTOWN_SPEC.md
claude Mar 31, 2026
f44d1fd
ci: add SAST tooling (semgrep, trufflehog)
Apr 1, 2026
fa9c9d5
chore: add governance baselines, rulesets, and update security workflow
Apr 2, 2026
07c09bc
Merge origin/main into feat/kilo-gastown-spec-and-sast
Apr 2, 2026
faafc4f
ci: refresh sast and pr readiness tooling
Apr 2, 2026
52b6035
ci: fix models catalog refresh path
Apr 2, 2026
b460bab
fix: unblock secret scan and codex executor syntax
Apr 2, 2026
576b830
ci: tighten quick sast to pr delta and fix gofmt debt
Apr 2, 2026
eac2d7f
fix(security): clear semgrep findings on pr diff
Apr 2, 2026
d530d80
ci: harden governance and security baselines
Apr 2, 2026
82b4a6d
chore(imports): repair pr942 package surfaces
Apr 2, 2026
0397335
test(imports): reduce stacked branch path debt
Apr 2, 2026
27551c9
fix(translator): repair byte-buffer sjson handling
Apr 2, 2026
05b1684
fix(registry): dedupe static model getters and cache invalidation
Apr 2, 2026
74f69a1
fix(config): dedupe oauth alias defaults
Apr 2, 2026
a026f0d
fix(auth): restore kilo token base storage
Apr 2, 2026
d61c9d8
fix(util): restore sanitized tool name helpers
Apr 2, 2026
6a1abca
fix(access): import sdk config alias
Apr 2, 2026
b251c74
fix(cursor): normalize nil auth context
Apr 2, 2026
a53c3d1
fix(executor): merge orphaned runtime executor tests and remove drift
Apr 2, 2026
c0aa5b9
fix(auth): restore claude base storage and transport imports
Apr 2, 2026
577a97e
test(usage): point logger plugin test at v7 sdk
Apr 2, 2026
bc1b381
test(translator): parse claude openai responses as bytes
Apr 2, 2026
886d08b
chore(auth): remove unused vertex auth implementation
Apr 2, 2026
5f48b29
ci: add Go module caching and fix matrix syntax
Apr 2, 2026
1ff2028
fix(auth): restore vertex auth package stub
Apr 2, 2026
11d4f4b
fix(auth): add missing imports and function definitions
Apr 2, 2026
1da7bf1
fix(translator): add translatorcommon and fix auth imports
Apr 3, 2026
c90b93f
style: format translatorcommon package
Apr 3, 2026
0981deb
fix(translator): add translatorcommon and fix imports
Apr 3, 2026
ebfc992
fix(translator): add translatorcommon and fix auth imports
Apr 3, 2026
a7a953d
fix(translator): replace sjson.Set with sjson.SetBytesM for []byte co…
Apr 3, 2026
5f0f32a
fix(translator): add sjson imports for SetBytesM compatibility
Apr 3, 2026
c981f27
style: format pkg/llmproxy/config/config.go
Apr 3, 2026
0c7e224
fix(translator): fix sjson function names and remove unused imports
Apr 3, 2026
6c88d84
fix(translator): fix type conversions for sjson.SetBytes
Apr 3, 2026
89f4547
style: format iflow_token.go and kimi/token.go
Apr 3, 2026
3030454
fix(translator): format openai-responses response file
Apr 3, 2026
cfbe3a2
revert: undo broken translator changes - preserve original code
Apr 3, 2026
c3a5501
ci: add tool layering with continue-on-error for Semgrep, License, an…
Apr 3, 2026
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
52 changes: 52 additions & 0 deletions .github/RULESET_BASELINE.md
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
9 changes: 9 additions & 0 deletions .github/release-required-checks.txt
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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Same issue as .github/required-checks.txt: this manifest is validated against workflow job name: fields, but several referenced jobs use different name: values or omit name: entirely. Align the manifest values with the actual job name: strings, or set the job name: fields to match these manifest entries.

Suggested change
sast-quick.yml|license-check

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +10
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

Same issue as .github/required-checks.txt: these required-check names must match workflow job name: lines. As written, sast-quick.yml jobs are named "Semgrep Scan"/"Secret Scanning"/"Go Quality"/"License Compliance" (not semgrep/secrets/etc.), and several referenced workflows don’t define job names for the listed entries.

Align this manifest with the actual job names, and/or add explicit job name: fields in the referenced workflows so required-check-names-guard can validate them.

Suggested change
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 Compliance

Copilot uses AI. Check for mistakes.
pr-test-build.yml|go-ci
pr-test-build.yml|quality-ci
pr-test-build.yml|quality-staged-check
Expand Down
10 changes: 9 additions & 1 deletion .github/required-checks.txt
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
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

pr-test-build.yml|build is listed as required, but the pr-test-build workflow currently writes the refreshed model catalog to internal/registry/models/models.json, and that directory no longer exists in this repo. This makes the required build check fail before it even compiles.

Update pr-test-build.yml to write to pkg/llmproxy/registry/models/models.json (matching the go:embed path) or restore the expected directory.

Suggested change
pr-test-build.yml|build

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The entries in .github/required-checks.txt appear to use job IDs (e.g., semgrep, secrets, enforce), but required-check-names-guard.yml validates against workflow job name: fields. As written, several workflows either have different job names (e.g., Semgrep Scan) or no job name: at all, so the guard will fail. Either update the manifest to match the exact job name: strings, or add/update each job's name: to match the manifest values consistently.

Suggested change
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|Secrets Scan
sast-quick.yml|Go Quality
sast-quick.yml|License Check

Copilot uses AI. Check for mistakes.
35 changes: 35 additions & 0 deletions .github/rulesets/main.json
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"]
}
},
{
"type": "copilot_code_review",
"parameters": {
"review_on_push": true,
"review_draft_pull_requests": true
}
}
]
}
51 changes: 41 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
name: CI

on:
push:
branches: [main]
branches: [main, feature/*, bugfix/*, docs/*, release/*, hotfix/*]
pull_request:
branches: [main]

jobs:
ci:
test:
runs-on: ubuntu-latest

strategy:
matrix:
go-version: ['1.21', '1.22']

steps:
- uses: actions/checkout@v4

- 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
- uses: actions/setup-go@v5
mkdir -p pkg/llmproxy/registry/models
git show FETCH_HEAD:models.json > pkg/llmproxy/registry/models/models.json

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Cache Go modules
uses: actions/cache@v4
with:
go-version-file: go.mod
cache: true
- name: Vet
run: go vet ./...
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download

- name: Build
run: go build ./...
- name: Test
run: go test ./...

- name: Run tests
run: go test ./... -v -race -coverprofile=coverage.out

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.out


phenotype-validate:
runs-on: ubuntu-latest
uses: KooshaPari/phenotypeActions/.github/workflows/validate-governance.yml@main
92 changes: 92 additions & 0 deletions .github/workflows/sast-full.yml
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:
contents: read
security-events: write

jobs:
codeql:
name: CodeQL Analysis
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
language: [go, javascript]
steps:
- uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4

trivy-repo:
name: Trivy Repository Scan
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: aquasecurity/trivy-action@v0.35.0
with:
scan-type: fs
scan-ref: .
format: sarif
output: trivy-results.sarif
- name: Upload Trivy SARIF
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: trivy-results.sarif
category: trivy

full-semgrep:
name: Full Semgrep Analysis
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- 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
run: |
semgrep scan \
--config .semgrep-rules/ \
--config p/security-audit \
--config p/owasp-top-ten \
--config p/cwe-top-25 \
--error \
--sarif \
--output semgrep.sarif \
.

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: semgrep.sarif
category: semgrep-full

full-secrets:
name: Full Secret Scan
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: trufflesecurity/trufflehog@v3.94.2
with:
path: ./
extra_args: --only-verified
86 changes: 86 additions & 0 deletions .github/workflows/sast-quick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
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: 15
# Tier 3: Advisory - security enrichment only
continue-on-error: true
steps:
Comment on lines +12 to +19
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This workflow defines job name: values like "Semgrep Scan" / "Secret Scanning" but the required-check manifests list semgrep / secrets / etc. Since required-check-names-guard.yml matches against the name: fields, either update these job name: strings to the required-check values (or remove them so the manifest can use IDs), or update the manifests to match the human-readable names exactly.

Copilot uses AI. Check for mistakes.
- 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 }}
run: |
semgrep scan --sarif --sarif-output=semgrep.sarif --max-target-bytes 1000000 --quiet --config=auto || true
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: semgrep.sarif

# License Compliance - Tier 3: Advisory
license-compliance:
name: License Compliance
runs-on: ubuntu-latest
timeout-minutes: 10
# Tier 3: Advisory - security enrichment only
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Analyze licenses
uses: fsfe/reuse-action@v4
continue-on-error: true # Allow findings but don't fail
- name: Check for non-reusable licenses
run: |
# Check for problematic licenses
grep -r "GPL\|AGPL" --include="*.toml" --include="*.json" . || true
- name: Check license compliance
uses: fsfe/reuse-action@v4
continue-on-error: true

# Secret Scanning - Tier 2: Important (runs in parallel)
secrets:
name: Secret Scanning
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --verbose --redact
- name: Run Trivy Secret Scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: repo
exit-code: 0
format: sarif
output: trivy-results.sarif
continue-on-error: true
- name: Upload Trivy results
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: 'trivy-results.sarif'
26 changes: 20 additions & 6 deletions .github/workflows/security-guard.yml
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:
secrets:
GITGUARDIAN_API_KEY:
required: true
workflow_dispatch:

Comment on lines +1 to +9
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

security-guard.yml is listed as a required check, but this workflow currently only runs on workflow_dispatch or when explicitly called via workflow_call. There is no in-repo caller for it, and it won't run automatically on PRs/pushes, so the required check may never appear and merges can be blocked. Add a pull_request (and/or push) trigger, or add a dedicated caller workflow that runs on PRs and invokes this workflow.

Copilot uses AI. Check for mistakes.
jobs:
audit:
ggshield-scan:
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This workflow defines the ggshield-scan job without a job-level name:. The required-check-names-guard validates required checks by grepping for name: lines, so .github/required-checks.txt entries referencing this job cannot be satisfied. Add a job-level name: (e.g., GGShield Scan) and update the required-check manifest to that exact string.

Suggested change
ggshield-scan:
ggshield-scan:
name: GGShield Scan

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
permissions:
contents: read
steps:
Comment on lines 10 to 15
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The required-check name guard only recognizes checks that appear as explicit name: lines in the workflow YAML. This job doesn’t define a name:, so an entry like security-guard.yml|ggshield-scan won’t match anything and will fail the guard. Add a job-level name: (e.g., name: ggshield-scan or a human-friendly name) and ensure the required-check manifests use that exact value.

Copilot uses AI. Check for mistakes.
- uses: actions/checkout@v4
- name: Run security audit
run: echo "Security audit placeholder - no script available yet"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
- name: Install ggshield
run: pip install ggshield==1.38.0
- name: Run ggshield secret scan
env:
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
run: ggshield secret scan path . --recursive
Comment on lines 10 to +23
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

This workflow’s only job does not set a job-level name:. Because required-check-names-guard validates required checks by grepping for a matching name: line, .github/required-checks.txt entries like security-guard.yml|ggshield-scan will fail unless this job adds name: ggshield-scan (or the manifest is updated to match whatever job name you choose).

Copilot uses AI. Check for mistakes.
Loading
Loading