Compare commits

..

3 Commits

Author SHA1 Message Date
Carlos Polop
10e1786e6d Trigger PR tests after chack-agent fix 2026-02-11 14:12:27 +01:00
chack-agent
e60c50100e Fix CI failures for PR #585 2026-02-11 13:10:57 +00:00
Carlos Polop
8e917c239f Test chack-agent workflows with intentional PR failure 2026-02-11 13:52:44 +01:00
6 changed files with 16 additions and 133 deletions

View File

@@ -12,8 +12,6 @@ jobs:
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
env:
CHACK_LOGS_HTTP_URL: ${{ secrets.CHACK_LOGS_HTTP_URL }}
outputs: outputs:
should_run: ${{ steps.gate.outputs.should_run }} should_run: ${{ steps.gate.outputs.should_run }}
pr_number: ${{ steps.gate.outputs.pr_number }} pr_number: ${{ steps.gate.outputs.pr_number }}
@@ -82,25 +80,13 @@ jobs:
${{ steps.gate.outputs.base_ref }} \ ${{ steps.gate.outputs.base_ref }} \
+refs/pull/${{ steps.gate.outputs.pr_number }}/head +refs/pull/${{ steps.gate.outputs.pr_number }}/head
- name: Set up Node.js for Codex
if: ${{ steps.gate.outputs.should_run == 'true' }}
uses: actions/setup-node@v5
with:
node-version: "20"
- name: Install Codex CLI
if: ${{ steps.gate.outputs.should_run == 'true' }}
run: |
npm install -g @openai/codex
codex --version
- name: Run Chack Agent - name: Run Chack Agent
id: run_chack id: run_chack
if: ${{ steps.gate.outputs.should_run == 'true' }} if: ${{ steps.gate.outputs.should_run == 'true' }}
uses: carlospolop/chack-agent@master uses: carlospolop/chack-agent@master
with: with:
provider: codex provider: openrouter
model_primary: CHEAP_BUT_QUALITY model_primary: BEST_QUALITY
main_action: peass-ng main_action: peass-ng
sub_action: Chack-Agent PR Triage sub_action: Chack-Agent PR Triage
system_prompt: | system_prompt: |
@@ -110,7 +96,6 @@ jobs:
Remember taht you are an autonomouts agent, use the exec tool to run the needed commands to list, read, analyze, modify, test... Remember taht you are an autonomouts agent, use the exec tool to run the needed commands to list, read, analyze, modify, test...
tools_config_json: "{\"exec_enabled\": true}" tools_config_json: "{\"exec_enabled\": true}"
session_config_json: "{\"long_term_memory_enabled\": false}" session_config_json: "{\"long_term_memory_enabled\": false}"
agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}"
output_schema_file: .github/chack-agent/pr-merge-schema.json output_schema_file: .github/chack-agent/pr-merge-schema.json
user_prompt: | user_prompt: |
You are reviewing PR #${{ steps.gate.outputs.pr_number }} for ${{ github.repository }}. You are reviewing PR #${{ steps.gate.outputs.pr_number }} for ${{ github.repository }}.
@@ -134,7 +119,7 @@ jobs:
Output JSON only, following the provided schema: Output JSON only, following the provided schema:
.github/chack-agent/pr-merge-schema.json .github/chack-agent/pr-merge-schema.json
openai_api_key: ${{ secrets.OPENAI_API_KEY }} openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }}
- name: Parse Chack Agent decision - name: Parse Chack Agent decision
id: parse id: parse
@@ -146,18 +131,9 @@ jobs:
import json import json
import os import os
raw = (os.environ.get('CHACK_MESSAGE', '') or '').strip() data = json.loads(os.environ.get('CHACK_MESSAGE', '') or '{}')
decision = 'comment'
message = 'Chack Agent did not provide details.'
try:
data = json.loads(raw or '{}')
if isinstance(data, dict):
decision = data.get('decision', 'comment') decision = data.get('decision', 'comment')
message = data.get('message', '').strip() or message message = data.get('message', '').strip() or 'Chack Agent did not provide details.'
else:
message = raw or message
except Exception:
message = raw or message
with open(os.environ['GITHUB_OUTPUT'], 'a') as handle: with open(os.environ['GITHUB_OUTPUT'], 'a') as handle:
handle.write(f"decision={decision}\n") handle.write(f"decision={decision}\n")
handle.write("message<<EOF\n") handle.write("message<<EOF\n")

View File

@@ -20,7 +20,6 @@ jobs:
env: env:
TARGET_BRANCH: master TARGET_BRANCH: master
FIX_BRANCH: chack-agent/ci-master-fix-${{ github.event.workflow_run.id }} FIX_BRANCH: chack-agent/ci-master-fix-${{ github.event.workflow_run.id }}
CHACK_LOGS_HTTP_URL: ${{ secrets.CHACK_LOGS_HTTP_URL }}
steps: steps:
- name: Checkout failing commit - name: Checkout failing commit
uses: actions/checkout@v5 uses: actions/checkout@v5
@@ -97,22 +96,12 @@ jobs:
echo "Leave the repo in a state ready to commit; changes will be committed and pushed automatically." echo "Leave the repo in a state ready to commit; changes will be committed and pushed automatically."
} > chack_prompt.txt } > chack_prompt.txt
- name: Set up Node.js for Codex
uses: actions/setup-node@v5
with:
node-version: "20"
- name: Install Codex CLI
run: |
npm install -g @openai/codex
codex --version
- name: Run Chack Agent - name: Run Chack Agent
id: run_chack id: run_chack
uses: carlospolop/chack-agent@master uses: carlospolop/chack-agent@master
with: with:
provider: codex provider: openrouter
model_primary: CHEAP_BUT_QUALITY model_primary: BEST_QUALITY
main_action: peass-ng main_action: peass-ng
sub_action: CI-master Failure Chack-Agent PR sub_action: CI-master Failure Chack-Agent PR
system_prompt: | system_prompt: |
@@ -121,8 +110,7 @@ jobs:
prompt_file: chack_prompt.txt prompt_file: chack_prompt.txt
tools_config_json: "{\"exec_enabled\": true}" tools_config_json: "{\"exec_enabled\": true}"
session_config_json: "{\"long_term_memory_enabled\": false}" session_config_json: "{\"long_term_memory_enabled\": false}"
agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}" openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
- name: Commit and push fix branch if changed - name: Commit and push fix branch if changed
id: push_fix id: push_fix
@@ -135,27 +123,9 @@ jobs:
rm -f chack_failure_summary.txt chack_prompt.txt chack_failed_steps_logs.txt rm -f chack_failure_summary.txt chack_prompt.txt chack_failed_steps_logs.txt
git add -A git add -A
# Avoid workflow-file pushes with token scopes that cannot write workflows.
git reset -- .github/workflows || true
git checkout -- .github/workflows || true
git clean -fdx -- .github/workflows || true
git reset -- chack_failure_summary.txt chack_prompt.txt chack_failed_steps_logs.txt git reset -- chack_failure_summary.txt chack_prompt.txt chack_failed_steps_logs.txt
if git diff --cached --name-only | grep -q '^.github/workflows/'; then
echo "Workflow-file changes are still staged; skipping push without workflows permission."
echo "pushed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --cached --quiet; then
echo "No committable changes left after filtering."
echo "pushed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
git commit -m "Fix CI-master failures for run #${{ github.event.workflow_run.id }}" git commit -m "Fix CI-master failures for run #${{ github.event.workflow_run.id }}"
if ! git push origin HEAD:"$FIX_BRANCH"; then git push origin HEAD:"$FIX_BRANCH"
echo "Push failed (likely token workflow permission limits); skipping PR creation."
echo "pushed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "pushed=true" >> "$GITHUB_OUTPUT" echo "pushed=true" >> "$GITHUB_OUTPUT"
- name: Create PR to master - name: Create PR to master

View File

@@ -64,8 +64,6 @@ jobs:
pull-requests: write pull-requests: write
issues: write issues: write
actions: read actions: read
env:
CHACK_LOGS_HTTP_URL: ${{ secrets.CHACK_LOGS_HTTP_URL }}
steps: steps:
- name: Comment on PR with failure info - name: Comment on PR with failure info
uses: actions/github-script@v7 uses: actions/github-script@v7
@@ -154,22 +152,12 @@ jobs:
echo "Leave the repo in a state ready to commit as when you finish, it'll be automatically committed and pushed." echo "Leave the repo in a state ready to commit as when you finish, it'll be automatically committed and pushed."
} > chack_prompt.txt } > chack_prompt.txt
- name: Set up Node.js for Codex
uses: actions/setup-node@v5
with:
node-version: "20"
- name: Install Codex CLI
run: |
npm install -g @openai/codex
codex --version
- name: Run Chack Agent - name: Run Chack Agent
id: run_chack id: run_chack
uses: carlospolop/chack-agent@master uses: carlospolop/chack-agent@master
with: with:
provider: codex provider: openrouter
model_primary: CHEAP_BUT_QUALITY model_primary: BEST_QUALITY
main_action: peass-ng main_action: peass-ng
sub_action: PR Failure Chack-Agent Dispatch sub_action: PR Failure Chack-Agent Dispatch
system_prompt: | system_prompt: |
@@ -179,8 +167,7 @@ jobs:
prompt_file: chack_prompt.txt prompt_file: chack_prompt.txt
tools_config_json: "{\"exec_enabled\": true}" tools_config_json: "{\"exec_enabled\": true}"
session_config_json: "{\"long_term_memory_enabled\": false}" session_config_json: "{\"long_term_memory_enabled\": false}"
agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}" openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
- name: Commit and push if changed - name: Commit and push if changed
env: env:
@@ -193,24 +180,9 @@ jobs:
fi fi
rm -f chack_failure_summary.txt chack_prompt.txt rm -f chack_failure_summary.txt chack_prompt.txt
git add -A git add -A
# Avoid workflow-file pushes with token scopes that cannot write workflows.
git reset -- .github/workflows || true
git checkout -- .github/workflows || true
git clean -fdx -- .github/workflows || true
git reset -- chack_failure_summary.txt chack_prompt.txt git reset -- chack_failure_summary.txt chack_prompt.txt
if git diff --cached --name-only | grep -q '^.github/workflows/'; then
echo "Workflow-file changes are still staged; skipping push without workflows permission."
exit 0
fi
if git diff --cached --quiet; then
echo "No committable changes left after filtering."
exit 0
fi
git commit -m "Fix CI failures for PR #${PR_NUMBER}" git commit -m "Fix CI failures for PR #${PR_NUMBER}"
if ! git push origin HEAD:${TARGET_BRANCH}; then git push origin HEAD:${TARGET_BRANCH}
echo "Push failed (likely token workflow permission limits); leaving run successful without push."
exit 0
fi
- name: Comment with Chack Agent result - name: Comment with Chack Agent result
if: ${{ steps.run_chack.outputs.final-message != '' }} if: ${{ steps.run_chack.outputs.final-message != '' }}

View File

@@ -53,3 +53,4 @@ if __name__ == "__main__":
exit(1) exit(1)
main(all_modules, all_no_fat_modules, no_network_scanning, small, include_modules, exclude_modules, output) main(all_modules, all_no_fat_modules, no_network_scanning, small, include_modules, exclude_modules, output)

View File

@@ -1,36 +0,0 @@
# Title: Users Information - subuid/subgid mappings
# ID: UG_Subuid_subgid_mappings
# Author: Carlos Polop
# Last Update: 13-02-2026
# Description: Show delegated user namespace ID ranges from /etc/subuid and /etc/subgid.
# License: GNU GPL
# Version: 1.0
# Functions Used: print_2title
# Global Variables: $MACPEAS
# Initial Functions:
# Generated Global Variables:
# Fat linpeas: 0
# Small linpeas: 1
print_2title "User namespace mappings (subuid/subgid)"
if [ "$MACPEAS" ]; then
echo "Not applicable on macOS"
else
if [ -r /etc/subuid ]; then
echo "subuid:"
grep -v -E '^\s*#|^\s*$' /etc/subuid 2>/dev/null
else
echo "/etc/subuid not readable or not present"
fi
if [ -r /etc/subgid ]; then
echo ""
echo "subgid:"
grep -v -E '^\s*#|^\s*$' /etc/subgid 2>/dev/null
else
echo "/etc/subgid not readable or not present"
fi
fi
echo ""

View File

@@ -46,7 +46,7 @@ class LinpeasBuilder:
def build(self): def build(self):
print("[+] Building variables...") print("[+] Building variables...")
variables = self.__generate_variabless() variables = self.__generate_variables()
self.__replace_mark(PEAS_VARIABLES_MARKUP, variables, "") self.__replace_mark(PEAS_VARIABLES_MARKUP, variables, "")
if len(re.findall(r"PSTORAGE_[a-zA-Z0-9_]+", self.linpeas_sh)) > 1: #Only add storages if there are storages (PSTORAGE_BACKUPS is always there so it doesn't count) if len(re.findall(r"PSTORAGE_[a-zA-Z0-9_]+", self.linpeas_sh)) > 1: #Only add storages if there are storages (PSTORAGE_BACKUPS is always there so it doesn't count)