Skip to content

Add sentrux shared component and daily codebase quality report workflow#28970

Merged
pelikhan merged 1 commit intomainfrom
copilot/add-shared-agentic-workflow
Apr 28, 2026
Merged

Add sentrux shared component and daily codebase quality report workflow#28970
pelikhan merged 1 commit intomainfrom
copilot/add-shared-agentic-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

Summary

Adds two new workflow files that integrate sentrux — an architecture quality sensor that computes a continuous quality signal (0–10000) across 52 languages — into the gh-aw daily audit suite.

Changes

shared/mcp/sentrux.md

A reusable shared component that:

  • Installs the sentrux binary at a pinned version (v0.9.2) from the GitHub releases page, avoiding the curl | sh supply chain risk
  • Provides a brief body prompt explaining available sentrux CLI commands and how to use them

Import in any workflow with:

imports:
  - shared/mcp/sentrux.md

Note: sentrux uses stdio MCP transport, which is not supported by the MCP Gateway. The shared component installs the binary via a setup step; the agent invokes it through bash commands rather than MCP tools.

daily-sentrux-report.md

A daily scheduled workflow that:

  1. Runs sentrux check . and sentrux gate --save . on the workspace
  2. Parses the output to extract the quality signal, per-metric health scores, bottleneck, and rule violations
  3. Appends today's metrics to a JSON Lines history file in repo memory (90-day retention)
  4. Computes quality trends vs yesterday, 7 days, and 30 days
  5. Publishes a structured GitHub discussion report with the [daily-sentrux] title prefix, expiring after 3 days

Security Review

  • New secrets: None
  • New actions: None
  • Network changes: None — sentrux binary is downloaded from github.com/sentrux/sentrux/releases (HTTPS, pinned version)
  • Supply chain mitigation: Binary downloaded directly from a pinned release tag instead of piping an install script to shell

Copilot AI requested a review from pelikhan April 28, 2026 19:31
@pelikhan pelikhan marked this pull request as ready for review April 28, 2026 20:51
Copilot AI review requested due to automatic review settings April 28, 2026 20:51
@pelikhan pelikhan merged commit 71630a6 into main Apr 28, 2026
19 checks passed
@pelikhan pelikhan deleted the copilot/add-shared-agentic-workflow branch April 28, 2026 20:51
@github-actions github-actions Bot mentioned this pull request Apr 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Sentrux integration to the gh-aw daily audit suite by introducing a reusable install/prompt component and a new scheduled workflow that collects and reports architecture quality metrics over time.

Changes:

  • Added a shared MCP component to install a pinned sentrux binary and document CLI usage.
  • Added a daily scheduled “Daily Sentrux Report” workflow prompt that runs Sentrux scans, stores history in repo-memory, and publishes a GitHub Discussion.
  • Added the compiled lock workflow file for the new workflow.
Show a summary per file
File Description
.github/workflows/shared/mcp/sentrux.md Introduces shared installation + usage instructions for sentrux.
.github/workflows/daily-sentrux-report.md Defines the daily audit workflow prompt (scan, parse, persist history, publish report).
.github/workflows/daily-sentrux-report.lock.yml Generated compiled workflow output to run the new daily report in gh-aw.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 5

Comment on lines +55 to +59
Load the quality history from repo memory at `/tmp/gh-aw/repo-memory/daily/history.jsonl`. If the file does not exist, start a fresh history.

### 3. Append today's entry

Append a new JSON line to `/tmp/gh-aw/repo-memory/daily/history.jsonl`:
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The repo-memory path in the prompt (/tmp/gh-aw/repo-memory/daily/...) doesn’t match the compiled workflow’s configured memory directory (the lock file shows /tmp/gh-aw/repo-memory/default/ with branch daily/daily-sentrux-report). This will cause history writes to go to a non-persisted location and trends will never accumulate. Use the configured repo-memory directory (or the workflow-provided env like GH_AW_MEMORY_DIR) consistently for reads/writes.

Suggested change
Load the quality history from repo memory at `/tmp/gh-aw/repo-memory/daily/history.jsonl`. If the file does not exist, start a fresh history.
### 3. Append today's entry
Append a new JSON line to `/tmp/gh-aw/repo-memory/daily/history.jsonl`:
Load the quality history from repo memory at `${GH_AW_MEMORY_DIR}/history.jsonl`. If the file does not exist, start a fresh history.
### 3. Append today's entry
Append a new JSON line to `${GH_AW_MEMORY_DIR}/history.jsonl`:

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +59
Load the quality history from repo memory at `/tmp/gh-aw/repo-memory/daily/history.jsonl`. If the file does not exist, start a fresh history.

### 3. Append today's entry

Append a new JSON line to `/tmp/gh-aw/repo-memory/daily/history.jsonl`:
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The repo-memory path in the prompt (/tmp/gh-aw/repo-memory/daily/...) doesn’t match the compiled workflow’s configured memory directory (the lock file shows /tmp/gh-aw/repo-memory/default/ with branch daily/daily-sentrux-report). This will cause history writes to go to a non-persisted location and trends will never accumulate. Use the configured repo-memory directory (or the workflow-provided env like GH_AW_MEMORY_DIR) consistently for reads/writes.

Suggested change
Load the quality history from repo memory at `/tmp/gh-aw/repo-memory/daily/history.jsonl`. If the file does not exist, start a fresh history.
### 3. Append today's entry
Append a new JSON line to `/tmp/gh-aw/repo-memory/daily/history.jsonl`:
Load the quality history from repo memory at `${GH_AW_MEMORY_DIR}/history.jsonl`. If the file does not exist, start a fresh history.
### 3. Append today's entry
Append a new JSON line to `${GH_AW_MEMORY_DIR}/history.jsonl`:

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +27
SENTRUX_VERSION="0.9.2"
curl -fsSL -o /tmp/sentrux "https://github.com/sentrux/sentrux/releases/download/v${SENTRUX_VERSION}/sentrux-linux-x86_64"
chmod +x /tmp/sentrux
sudo mv /tmp/sentrux /usr/local/bin/sentrux
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

Pinning only the version tag reduces risk, but downloading an executable without validating a checksum/signature still leaves room for supply-chain compromise (e.g., release asset tampering). Add integrity verification (e.g., fetch a published SHA256SUMS file for the release and verify with sha256sum -c, or verify a signature if the project provides one) before installing the binary.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +27
curl -fsSL -o /tmp/sentrux "https://github.com/sentrux/sentrux/releases/download/v${SENTRUX_VERSION}/sentrux-linux-x86_64"
chmod +x /tmp/sentrux
sudo mv /tmp/sentrux /usr/local/bin/sentrux
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The install step assumes (1) the runner is Linux x86_64 and (2) sudo is available/allowed to write into /usr/local/bin. In more locked-down runners/containers or on ARM64, this will fail. Prefer installing into a user-writable directory (e.g., $RUNNER_TEMP/bin or $HOME/.local/bin) and add it to PATH, and select the correct asset based on uname -s/uname -m.

Suggested change
curl -fsSL -o /tmp/sentrux "https://github.com/sentrux/sentrux/releases/download/v${SENTRUX_VERSION}/sentrux-linux-x86_64"
chmod +x /tmp/sentrux
sudo mv /tmp/sentrux /usr/local/bin/sentrux
OS="$(uname -s)"
ARCH="$(uname -m)"
case "$OS" in
Linux) SENTRYX_OS="linux" ;;
Darwin) SENTRYX_OS="darwin" ;;
*)
echo "Unsupported operating system: $OS" >&2
exit 1
;;
esac
case "$ARCH" in
x86_64|amd64) SENTRYX_ARCH="x86_64" ;;
aarch64|arm64) SENTRYX_ARCH="arm64" ;;
*)
echo "Unsupported architecture: $ARCH" >&2
exit 1
;;
esac
INSTALL_DIR="${RUNNER_TEMP:-$HOME/.local}/bin"
mkdir -p "$INSTALL_DIR"
curl -fsSL -o "$INSTALL_DIR/sentrux" "https://github.com/sentrux/sentrux/releases/download/v${SENTRUX_VERSION}/sentrux-${SENTRYX_OS}-${SENTRYX_ARCH}"
chmod +x "$INSTALL_DIR/sentrux"
echo "$INSTALL_DIR" >> "$GITHUB_PATH"
export PATH="$INSTALL_DIR:$PATH"

Copilot uses AI. Check for mistakes.
# Check rules and capture output (continues even if rules fail)
sentrux check . 2>&1 | tee /tmp/sentrux-check.txt || true

# Save a gate baseline for comparison in future runs
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The prompt says the baseline is saved “for comparison in future runs,” but there’s no instruction to persist the baseline artifact anywhere (repo-memory, committed file, or cache), so it will be lost after the job finishes. Either adjust the wording to reflect that it’s only producing metrics for this run, or add steps/instructions to persist the gate baseline if future comparisons are intended.

Suggested change
# Save a gate baseline for comparison in future runs
# Generate gate baseline/output for this run's analysis

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants