Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/*.lock.yml linguist-generated=true merge=ours

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

merge=ours needs a configured merge driver and can hide lock-file drift.

Git has no built-in ours merge driver. Each clone must run git config merge.ours.driver true; otherwise Git falls back to the default merge for *.lock.yml and the attribute has no effect. Add this setup step to the contributor documentation or to the deploy script.

The behavior also carries a risk: when the driver is active, a merge keeps the local lock file and discards the incoming regenerated one. The lock file can then drift from .github/workflows/sfl-pr-review.md, and the workflow's own stale-lock-file check fails the run. Consider linguist-generated=true only, and regenerate with gh aw compile on conflict.

🛠️ Proposed alternative
-.github/workflows/*.lock.yml linguist-generated=true merge=ours
+.github/workflows/*.lock.yml linguist-generated=true
📝 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
.github/workflows/*.lock.yml linguist-generated=true merge=ours
.github/workflows/*.lock.yml linguist-generated=true
🤖 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 @.gitattributes at line 1, Remove the merge=ours attribute from the
.github/workflows/*.lock.yml pattern in .gitattributes, retaining only
linguist-generated=true. Avoid configuring a custom merge driver; resolve
lock-file conflicts by regenerating the files with gh aw compile so they remain
synchronized with the source workflow.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Configure the declared ours merge driver

When both branches regenerate a workflow lock file, merge=ours does not by itself select the current branch's copy: ours is a custom low-level merge-driver name that requires a merge.ours.driver Git configuration, and no such setup exists anywhere in this repository. A normal clone therefore still produces a content conflict instead of resolving generated lock files as intended; provide the driver setup or use a merge strategy that works without uncommitted local configuration.

Useful? React with 👍 / 👎.

9 changes: 9 additions & 0 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entries": {
"github/gh-aw-actions/setup@v0.84.1": {
"repo": "github/gh-aw-actions/setup",
"version": "v0.84.1",
"sha": "029204130cb73f6ba684e56428c7f3e9319b708c"
}
}
}
1,483 changes: 1,483 additions & 0 deletions .github/workflows/sfl-pr-review.lock.yml

Large diffs are not rendered by default.

185 changes: 185 additions & 0 deletions .github/workflows/sfl-pr-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
---
description: |
Standalone full-spectrum pull request review triggered by the sfl-review
label. Performs security, correctness and reliability, and quality and
maintainability passes, posts one inline thread per finding, submits a
consolidated review, and publishes the SFL Reviewer Approval check.

on:
label_command:
name: sfl-review
events: [pull_request]
remove_label: true

permissions:
contents: read
pull-requests: read

models:
default-ai-credits-pricing:
input: 3
output: 15

engine:
id: copilot
env:
COPILOT_PROVIDER_BASE_URL: https://openrouter.ai/api/v1
COPILOT_PROVIDER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
COPILOT_PROVIDER_TYPE: openai
COPILOT_PROVIDER_WIRE_API: responses
COPILOT_MODEL: moonshotai/kimi-k3

model: moonshotai/kimi-k3

network:
allowed:
- openrouter.ai

tools:
github:
toolsets: [pull_requests, repos]
github-app:
client-id: ${{ vars.SFL_APP_CLIENT_ID }}
private-key: ${{ secrets.SFL_APP_PRIVATE_KEY }}

safe-outputs:
threat-detection: false

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 | 🏗️ Heavy lift

Reconsider threat-detection: false for a workflow that ingests untrusted pull request content.

The agent reads the PR diff, title, and body. That content is attacker-controlled on fork pull requests, and a maintainer label can trigger the run on such a PR. With threat detection off, the only remaining barrier is the safe-outputs allowlist. That allowlist still permits up to 20 review comments, one review submission, and one check run under a GitHub App token with pull-requests: write and checks: write (lock file lines 1439-1446). Injected instructions can therefore publish attacker-authored content as an approving review.

Enable threat detection, or document why the bounded safe-output surface is accepted for this tier.

🤖 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/sfl-pr-review.md at line 46, Reconsider the
`threat-detection` setting in the workflow configuration and enable it for runs
processing untrusted pull request content. If it must remain disabled, document
the explicit security rationale and acceptance of the bounded safe-output
permissions near `threat-detection`, including the risks of attacker-controlled
review publication.

github-app:
client-id: ${{ vars.SFL_APP_CLIENT_ID }}
private-key: ${{ secrets.SFL_APP_PRIVATE_KEY }}
create-pull-request-review-comment:
side: RIGHT
max: 20
submit-pull-request-review:
allowed-events: [APPROVE, REQUEST_CHANGES]
supersede-older-reviews: true
footer: always
create-check-run:
max: 1
name: "SFL Reviewer Approval"
---
# Deployed from: HemSoft/set-it-free-loop/deployment/workflows/sfl-pr-review.md@78483bbf7edf0a4f8d3bf2f68e58678da36044ae
# To upgrade: re-run deploy-workflow.ps1 at the desired SHA

<!-- sfl:
status: active
version: "1.0.0"
category: review
risk-class: trivial
target-labels: [sfl-review]
outcome-definition: |
The triggering pull request receives a current-head structured review,
one inline thread per finding, and an SFL Reviewer Approval check.
acceptance-criteria:
- The sfl-review label triggers exactly one current-head review run
- The trigger label is consumed during authorized activation
- Security, correctness/reliability, and quality/maintainability are reviewed
- Every finding is an inline thread classified Critical, High, Medium, or Low
- The review body reports the run ID, head SHA, verdict, and severity counts
- Critical or High findings fail the approval check and request changes
- Medium or Low findings do not fail the approval check
- Zero findings produce an approving review and successful approval check
source-repo: HemSoft/set-it-free-loop
-->

# SFL Review - Full-Spectrum Pull Request Review

Review only the pull request that triggered this workflow. The reviewed commit
must be `${{ github.event.pull_request.head.sha }}` and the SFL run ID is
`${{ github.run_id }}`.

Use the GitHub pull request tools to read the triggering PR, its changed files,
and the complete diff. Before creating comments, list existing review comments
and unresolved threads on the current head so you do not repeat a finding.

## Required review passes

Perform all three evidence-based passes independently before producing output.

1. **Security**
- Injection, unsafe command or path construction, XSS, SSRF, and deserialization
- Authentication, authorization, privilege boundaries, and secret exposure
- Dependency, workflow, and supply-chain risks
2. **Correctness and Reliability**
- Logic errors, regressions, incorrect assumptions, null and boundary cases
- Error handling, races, resource leaks, data loss, and compatibility
- Whether tests cover every meaningful new or changed behavior
3. **Quality and Maintainability**
- Excessive complexity, duplication, coupling, unclear ownership, and dead code
- Type safety, performance regressions, operational risk, and repository conventions
- Whether the implementation is the smallest complete and defensible change

## Finding policy

Classify every finding into exactly one severity:

- **CRITICAL** - exploitable security issue, data loss, production crash,
public API break, race, or deadlock
- **HIGH** - serious correctness, authorization, reliability, or operational defect
- **MEDIUM** - material bug avenue, missing logic-branch tests, performance
regression, or maintainability problem
- **LOW** - actionable improvement with concrete value and low implementation risk

Do not report style preferences, speculative concerns, or findings without
specific evidence from the changed code.

For each finding, call `create-pull-request-review-comment` on the most precise
changed line. The comment body must begin with one of these exact prefixes:

- `**CRITICAL Finding**`
- `**HIGH Finding**`
- `**MEDIUM Finding**`
- `**LOW Finding**`

After the prefix, state the defect, impact, evidence, and a concrete fix.
Create exactly one inline thread per finding. If there are no findings, create
no inline comments.

## Approval policy

Count all inline findings by severity.

- If any Critical or High finding exists, submit `REQUEST_CHANGES` and create
the `SFL Reviewer Approval` check with conclusion `failure`.
- If only Medium or Low findings exist, submit `APPROVE` and create the check
with conclusion `success`.
- If no findings exist, submit `APPROVE` and create the check with conclusion
`success`.

Submit exactly one consolidated review with this body:

```markdown
## SFL Full-Spectrum Review

SFL run ID: ${{ github.run_id }}
Head SHA: ${{ github.event.pull_request.head.sha }}
Verdict: APPROVE

| Severity | Count |
| --- | ---: |
| Critical | 0 |
| High | 0 |
| Medium | 0 |
| Low | 0 |

### Review passes

- Security: complete
- Correctness and Reliability: complete
- Quality and Maintainability: complete

### Summary

Concise evidence-based summary of the review result.
```

Replace the verdict and counts with the actual result. Use
`Verdict: CHANGES_REQUESTED` when Critical or High findings exist.

Create exactly one check run named `SFL Reviewer Approval` with:

- `title`: `SFL full-spectrum review complete`
- `summary`: the verdict, head SHA, run ID, and severity counts
- `conclusion`: the approval-policy result above

Do not modify code, branches, pull request labels, or pull request metadata.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CLI Tools

[![Set it Free Loop](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FHemSoft%2Fcli-tools%2Fmain%2Fsfl.json&query=%24.version&prefix=v&label=Set%20it%20Free%20Loop&color=FFD700&style=flat&logo=githubactions&logoColor=white)](https://github.com/HemSoft/set-it-free-loop)
<!-- SFL_BADGE: auto-updated by deploy-workflow.ps1 -->
# CLI Tools

A collection of command-line interface tools and scripts for various automation tasks.

## Features
Expand Down
36 changes: 36 additions & 0 deletions sfl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": "2.0.0",
"deployedAt": "2026-08-02T04:06:49Z",
"tier": "review",
"source": "HemSoft/set-it-free-loop",
"sourceSha": "78483bbf7edf0a4f8d3bf2f68e58678da36044ae",
"components": [
"governance",
"labels",
"sfl-pr-review"
],
"enginePolicy": {
"defaultProfile": "codex-gpt-55-high",
"workflows": [
{
"name": "sfl-pr-review",
"profile": "openrouter-kimi-k3-high",
"provider": "copilot",
"model": "moonshotai/kimi-k3",
"effort": null,
"renderedModel": "moonshotai/kimi-k3",
"requiredSecretsAnyOf": [
"OPENROUTER_API_KEY"
],
"arguments": [],
"environment": {
"COPILOT_PROVIDER_BASE_URL": "https://openrouter.ai/api/v1",
"COPILOT_PROVIDER_API_KEY": "${{ secrets.OPENROUTER_API_KEY }}",
"COPILOT_PROVIDER_TYPE": "openai",
"COPILOT_PROVIDER_WIRE_API": "responses",
"COPILOT_MODEL": "moonshotai/kimi-k3"
}
}
]
}
}