Skip to content
Merged
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,727 changes: 1,727 additions & 0 deletions .github/workflows/daily-code-debt-aider.lock.yml

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions .github/workflows/daily-code-debt-aider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
private: true
emoji: "🧹"
description: Daily cleanup of TODO/FIXME comments and simple Go code debt using Aider
on:
schedule: daily
workflow_dispatch:
permissions:
contents: read
issues: read
pull-requests: read
sandbox:
agent:
sudo: false
tracker-id: daily-code-debt-aider
engine:
id: aider
model: copilot/claude-sonnet-4.5
strict: true
network:
allowed: []
Comment on lines +20 to +21
tools:
edit:
bash:
- "*"
safe-outputs:
create-pull-request:
expires: 2d
title-prefix: "[aider] "
labels: [automation, cleanup]
draft: false
missing-tool:
timeout-minutes: 30
imports:
- shared/aider.md
- shared/otlp.md
---

# Daily Code Debt Cleanup — Aider

You are an automated coding agent that reduces Go code debt by resolving actionable TODO/FIXME comments
and removing trivially dead code. Aider has no MCP client; all safe-output events must be written as
JSONL lines to `$GH_AW_SAFE_OUTPUTS`.

## Step 1 — Find actionable TODO/FIXME comments

```bash
grep -rn "TODO\|FIXME" \
--include="*.go" \
--exclude-dir=vendor \
--exclude-dir=.git \
. | grep -v "_test.go" | head -20
Comment on lines +48 to +52
```

From the output, identify at most **3 comments** that are:
- Self-contained (do not require external API changes or large refactors)
- Resolvable with ≤ 20 lines of code
- In a single file

Skip any comment that references an issue number (`#\d+`) or requires discussion.

## Step 2 — Resolve selected comments

For each selected comment:
1. Read the surrounding function to understand context.
2. Apply a minimal, correct fix using the `edit` tool.
3. Remove or update the TODO/FIXME marker after the fix.

## Step 3 — Verify the build still compiles

```bash
GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod go build ./...
```

If the build fails, revert the last change:

```bash
git diff --name-only | xargs git checkout --
```

## Step 4 — Format and create PR

If any code was changed:
1. Run `make fmt || true`
2. Write the following JSONL to `$GH_AW_SAFE_OUTPUTS`:

```
{"type":"create_pull_request","title":"Resolve actionable TODO/FIXME comments","body":"Automated cleanup of self-contained TODO and FIXME comments.\n\nChanges applied:\n<list each file and comment resolved>"}
```
Comment on lines +83 to +89

If nothing was changed (no actionable items found), write:

```
{"type":"noop","reason":"No actionable TODO/FIXME comments found — skipping cleanup."}
```

## Exit rule

**Always** write at least one JSONL line to `$GH_AW_SAFE_OUTPUTS` before finishing.
1,727 changes: 1,727 additions & 0 deletions .github/workflows/daily-go-test-stubs-aider.lock.yml

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions .github/workflows/daily-go-test-stubs-aider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
private: true
emoji: "🧪"
description: Daily scan of Go packages for missing test coverage and automatic addition of test stubs using Aider
on:
schedule: daily
workflow_dispatch:
permissions:
contents: read
issues: read
pull-requests: read
sandbox:
agent:
sudo: false
tracker-id: daily-go-test-stubs-aider
engine:
id: aider
model: copilot/claude-sonnet-4.5
strict: true
network:
allowed: []
Comment on lines +20 to +21
tools:
edit:
bash:
- "*"
safe-outputs:
create-pull-request:
expires: 2d
title-prefix: "[aider] "
labels: [automation, testing]
draft: false
missing-tool:
timeout-minutes: 30
imports:
- shared/aider.md
- shared/otlp.md
---

# Daily Go Test Stubs — Aider

You are an automated coding agent that improves Go test coverage by finding untested packages and adding
minimal test stubs. Aider has no MCP client; all safe-output events must be written as JSONL lines to
`$GH_AW_SAFE_OUTPUTS`.

## Step 1 — Find packages with no test files

```bash
find . -name "*.go" -not -name "*_test.go" -not -path "*/vendor/*" -not -path "*/.git/*" \
| sed 's|/[^/]*\.go$||' | sort -u \
Comment on lines +48 to +49
| while read pkg; do
test_count=$(find "$pkg" -maxdepth 1 -name "*_test.go" 2>/dev/null | wc -l)
if [ "$test_count" -eq 0 ]; then echo "$pkg"; fi
done | head -5
```

Pick at most 3 packages from the output.

## Step 2 — Add minimal test stubs

For each selected package, create a `<package>_test.go` stub that:
- Declares the correct package name (use `package <pkg>_test` if the source uses external test convention, otherwise `package <pkg>`)
- Imports `"testing"`
- Contains one `TestPlaceholder_TODO` function with `t.Skip("not yet implemented")`

Write the file using the `edit` tool.

## Step 3 — Commit and create PR

If any stubs were created:
1. Run `make fmt` (ignore errors if no Makefile target exists — catch with `|| true`)
2. Confirm the build still passes: `GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod go build ./...`
3. Write the following JSONL line to `$GH_AW_SAFE_OUTPUTS` to create a pull request:

```
{"type":"create_pull_request","title":"Add test stubs for uncovered packages","body":"Automatically generated test stubs for packages with zero test coverage.\n\nPackages updated: <list>\n\nStubs use `t.Skip` and are ready to be filled in."}
```
Comment on lines +69 to +76

If no packages needed stubs (all packages already had tests), write:

```
{"type":"noop","reason":"All Go packages already have test files — no stubs needed."}
```

## Step 4 — Exit rule

**Always** write at least one JSONL line to `$GH_AW_SAFE_OUTPUTS` before finishing.
Loading
Loading