Skip to content

Scaffold autonomous automation: deps auto-merge + idea-to-PR pipeline#221

Draft
rjayasinghe wants to merge 4 commits into
cap-java:mainfrom
rjayasinghe:automation/scaffolding
Draft

Scaffold autonomous automation: deps auto-merge + idea-to-PR pipeline#221
rjayasinghe wants to merge 4 commits into
cap-java:mainfrom
rjayasinghe:automation/scaffolding

Conversation

@rjayasinghe

Copy link
Copy Markdown
Contributor

Draft — for discussion. Not ready to merge.

This PR scaffolds three automation lanes for the repo. None of them
activate until a maintainer flips the corresponding switches in the
GitHub UI — see .github/AUTOMATION.md for the
checklist. So merging this is safe; it adds files but changes no
runtime behavior on its own.

Why

The goal is to drive maintenance and feature development with as little
human toil as possible, while keeping every code change behind a human
review gate.

Three lanes

Lane 1 — Dependency hygiene (autonomous)

File What
.github/dependabot.yml Patch+minor grouped weekly; majors stay separate
auto-merge-deps.yml Approves + enables auto-merge for non-major Dependabot PRs
dependabot-triage.yml Claude summarises changelog risk on major bumps
dependabot-stuck-sweep.yml Weekly cron — Claude attempts fixes on PRs stuck >7 days

Branch protection (required CI green) remains the hard gate. Auto-merge
just clicks the button when it's safe.

Lane 2 — Idea-to-PR (semi-autonomous)

Drop a markdown spec in ideas/, iterate it on a PR (Claude critiques),
merge it with status: ready, and idea-implement.yml opens a code PR
implementing it. Code PRs are never auto-merged — humans review.

File What
ideas/README.md Convention + frontmatter schema
ideas/_example.md Worked example (delete or keep)
idea-pr-opened.yml Claude critiques spec PRs
idea-implement.yml Push-to-main trigger; implements status: ready ideas

Fork hardening: idea-implement.yml triggers on push: main, not
pull_request. Forks can't push to main. Combined with
CODEOWNERS requiring code-owner review on /ideas/, this means only
contributors can authorize implementation.

Lane 3 — Weekly maintenance

maintenance.yml runs Mondays: README drift, snippet validity, stale
TODOs, mvn dependency:analyze. Findings are filed as draft idea
PRs
, feeding back into Lane 2. No code is changed directly.

What a maintainer needs to do to activate

See .github/AUTOMATION.md — TL;DR:

  1. Add ANTHROPIC_API_KEY secret
  2. Branch protection on main: required checks, code-owner review, allow auto-merge
  3. Actions setting: require approval for fork workflows
  4. Create labels: needs-review, major-update, automation, idea
  5. Update CODEOWNERS to use the real team handle (placeholder is @cap-java/maintainers)

What's deliberately conservative

  • Stuck Dependabot, idea-implement, and maintenance all open PRs — never push to main.
  • Implementation agent has a 1500-LOC diff cap and 60-min wall-clock timeout
  • Major dep bumps don't auto-merge
  • Claude workflows have explicit --max-turns caps
  • The killswitch (revoking ANTHROPIC_API_KEY) breaks Claude jobs cleanly

What's not in this PR

  • Migrating to Renovate — kept Dependabot to preserve Piper-aware tooling and the team's existing mental model.
  • Bedrock/Vertex auth wiring — the workflows use ANTHROPIC_API_KEY; swap if you prefer.
  • An issue → idea converter — easy to add later if you want external contributors to funnel ideas via Issues.

Happy to split this into smaller PRs (Lane 1 first, then Lane 2, then Lane 3) if that's easier to land.

Adds three automation lanes, all opt-in via .github/AUTOMATION.md:

Lane 1 — dependency hygiene
  - Group dependabot patch+minor into weekly PRs (keep majors separate)
  - auto-merge-deps.yml: approve + enable auto-merge for non-major bumps;
    label majors needs-review
  - dependabot-triage.yml: Claude summarises changelog risk on major bumps
  - dependabot-stuck-sweep.yml: weekly cron, Claude attempts fixes on
    Dependabot PRs stuck >7 days

Lane 2 — idea-to-PR
  - ideas/ directory with README convention + example spec
  - idea-pr-opened.yml: Claude critiques spec PRs
  - idea-implement.yml: on push-to-main of a 'status: ready' idea,
    Claude implements on a branch, runs mvn verify, opens a PR for
    human review (never auto-merges)

Lane 3 — maintenance
  - Weekly cron: README drift, snippet check, stale TODOs, dependency:analyze.
    Findings filed as draft idea PRs, feeding back into Lane 2.

Hardening
  - .github/CODEOWNERS gates ideas/ and workflow changes
  - .github/AUTOMATION.md documents required GitHub UI toggles
    (branch protection, fork-PR approval gate, code-owner reviews,
    ANTHROPIC_API_KEY secret)
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Scaffold Autonomous Automation: Dependency Auto-Merge + Idea-to-PR Pipeline

New Feature

✨ Introduces three automation lanes powered by GitHub Actions and Claude AI to reduce maintenance toil while keeping all code changes behind a human review gate. No existing runtime behavior is changed — this PR only adds files. Activation requires a maintainer to configure secrets, branch protection rules, and labels as described in the new .github/AUTOMATION.md.

Changes

Three automation lanes:

Lane 1 — Dependency hygiene (autonomous)

  • .github/dependabot.yml: Updated schedule from daily to weekly; added grouping for patch/minor bumps (Maven + GitHub Actions), keeping major updates as individual PRs.
  • .github/workflows/auto-merge-deps.yml: Auto-approves and enables squash auto-merge for patch/minor Dependabot PRs; flags major bumps with needs-review and major-update labels for human review.
  • .github/workflows/dependabot-triage.yml: On major-update label, uses Claude to fetch changelogs, assess risk (LOW/MEDIUM/HIGH), and post a structured summary comment on the PR.
  • .github/workflows/dependabot-stuck-sweep.yml: Weekly cron (Mondays) — Claude attempts to fix Dependabot PRs stuck >7 days with failing checks; leaves a blocking summary comment if unfixable.

Lane 2 — Idea-to-PR (semi-autonomous)

  • ideas/README.md: Documents the idea submission convention, frontmatter schema (draftreadyin-progressdone), and lifecycle.
  • ideas/_example.md: Worked example idea spec (broker reconnection events) demonstrating the expected format.
  • .github/workflows/idea-pr-opened.yml: Claude critiques idea spec PRs — checks for missing sections, ambiguity, codebase conflicts, and estimates implementation size.
  • .github/workflows/idea-implement.yml: Triggered on push to main for ideas/*.md files with status: ready; Claude implements the spec, runs mvn verify, and opens a code PR (never auto-merged). Hard caps: 1500 LOC diff, 60-minute timeout, --max-turns 300.

Lane 3 — Weekly maintenance

  • .github/workflows/maintenance.yml: Weekly cron (Mondays) — Claude checks README drift, snippet validity, stale TODOs (>90 days), and mvn dependency:analyze. Findings are filed as draft idea PRs feeding back into Lane 2. No direct code changes.

Supporting files

  • .github/AUTOMATION.md: Operator checklist — secrets, branch protection, Actions permissions, required labels, and CODEOWNERS setup.
  • .github/CODEOWNERS: Requires code-owner review for ideas/, .github/workflows/, and dependabot.yml (placeholder team @cap-java/maintainers — replace before enabling).

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.26.11

  • Summary Prompt: Default Prompt
  • Correlation ID: bd316523-fb50-47bd-9afe-a3489b02e362
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.opened
  • Output Template: Default Template
  • LLM: anthropic--claude-4.6-sonnet

Replace placeholder @cap-java/maintainers with the actual team
@cap-java/cds-feature-advanced-event-mesh-team. Update AUTOMATION.md
note accordingly.
When this fork runs Dependabot / idea-implement / maintenance, changes
land on the fork's main while upstream's main moves independently.
Without sync, drift compounds and reconciliation gets painful.

upstream-sync.yml runs daily:
  - in-sync / ahead: no-op
  - behind: fast-forward main, push
  - diverged: rebase, force-push with --force-with-lease
  - conflicts: leave main alone, file an issue with the conflicting
    files and a suggested resolution recipe

Guarded with 'if: github.repository \!= cap-java/...' so it never runs
on the upstream repo even if accidentally merged there.
…s/claude-code-action

We don't call Anthropic directly — LLM access is routed through SAP AI
Core. Adopting the pattern from cap/sherlock:

- opencode CLI (headless, 'opencode run') replaces claude-code-action.
  Provider is opencode's built-in sap-ai-core; auth via XSUAA OAuth2
  client-credentials, handled internally by the provider. No proxy
  process needed.
- AICORE_SERVICE_KEY (JSON service key) replaces ANTHROPIC_API_KEY as
  the single secret.
- Model is configured in .github/bot-config/opencode.json — defaults
  to sap-ai-core/anthropic--claude-4.6-opus, swappable to sonnet/gpt-5/
  gemini-2.5-pro without touching workflows.
- .github/actions/setup-opencode is a reusable composite action that
  installs opencode at a pinned version with SHA256 verification.

Five workflows updated to the new pattern: dependabot-triage,
dependabot-stuck-sweep, idea-pr-opened, idea-implement, maintenance.
AUTOMATION.md rewritten to document the new auth model and credit
the sherlock pattern.
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.

1 participant