karajan-code 1.11.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/docs/README.es.md +2 -1
- package/package.json +1 -1
- package/src/becaria/dispatch.js +99 -0
- package/src/becaria/index.js +3 -0
- package/src/becaria/pr-diff.js +26 -0
- package/src/becaria/repo.js +45 -0
- package/src/cli.js +2 -0
- package/src/commands/doctor.js +56 -1
- package/src/commands/init.js +33 -0
- package/src/commands/review.js +54 -2
- package/src/config.js +11 -0
- package/src/git/automation.js +65 -2
- package/src/mcp/tools.js +1 -0
- package/src/orchestrator/iteration-stages.js +85 -3
- package/src/orchestrator/solomon-rules.js +25 -2
- package/src/orchestrator.js +194 -6
- package/src/prompts/coder.js +5 -1
- package/src/prompts/reviewer.js +2 -0
- package/src/review/scope-filter.js +153 -0
- package/src/roles/coder-role.js +3 -2
- package/templates/roles/coder.md +11 -7
- package/templates/roles/planner.md +2 -0
- package/templates/roles/refactorer.md +1 -1
- package/templates/roles/reviewer.md +11 -4
- package/templates/workflows/automerge.yml +30 -0
- package/templates/workflows/becaria-gateway.yml +58 -0
- package/templates/workflows/houston-override.yml +46 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# BecarIA Gateway — publishes PR comments and reviews from repository_dispatch events.
|
|
2
|
+
# Triggered by Karajan Code pipeline via `gh api repos/{owner}/{repo}/dispatches`.
|
|
3
|
+
#
|
|
4
|
+
# Required secrets:
|
|
5
|
+
# BECARIA_APP_ID — GitHub App ID for becaria-reviewer
|
|
6
|
+
# BECARIA_APP_PRIVATE_KEY — PEM private key for the GitHub App
|
|
7
|
+
|
|
8
|
+
name: BecarIA Gateway
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
repository_dispatch:
|
|
12
|
+
types:
|
|
13
|
+
- becaria-comment
|
|
14
|
+
- becaria-review
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
pull-requests: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
gateway:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- name: Generate App Token
|
|
25
|
+
id: app-token
|
|
26
|
+
uses: actions/create-github-app-token@v1
|
|
27
|
+
with:
|
|
28
|
+
app-id: ${{ secrets.BECARIA_APP_ID }}
|
|
29
|
+
private-key: ${{ secrets.BECARIA_APP_PRIVATE_KEY }}
|
|
30
|
+
|
|
31
|
+
- name: Post Comment
|
|
32
|
+
if: github.event.action == 'becaria-comment'
|
|
33
|
+
uses: actions/github-script@v7
|
|
34
|
+
with:
|
|
35
|
+
github-token: ${{ steps.app-token.outputs.token }}
|
|
36
|
+
script: |
|
|
37
|
+
const { pr_number, agent, body } = context.payload.client_payload;
|
|
38
|
+
await github.rest.issues.createComment({
|
|
39
|
+
owner: context.repo.owner,
|
|
40
|
+
repo: context.repo.repo,
|
|
41
|
+
issue_number: pr_number,
|
|
42
|
+
body: `**${agent}** (via BecarIA)\n\n${body}`
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
- name: Submit Review
|
|
46
|
+
if: github.event.action == 'becaria-review'
|
|
47
|
+
uses: actions/github-script@v7
|
|
48
|
+
with:
|
|
49
|
+
github-token: ${{ steps.app-token.outputs.token }}
|
|
50
|
+
script: |
|
|
51
|
+
const { pr_number, event, body, agent } = context.payload.client_payload;
|
|
52
|
+
await github.rest.pulls.createReview({
|
|
53
|
+
owner: context.repo.owner,
|
|
54
|
+
repo: context.repo.repo,
|
|
55
|
+
pull_number: pr_number,
|
|
56
|
+
event: event,
|
|
57
|
+
body: `**${agent}** (via BecarIA)\n\n${body}`
|
|
58
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Houston Override — allows a human to force-approve a PR by commenting "/houston approve".
|
|
2
|
+
# Bypasses BecarIA's REQUEST_CHANGES review.
|
|
3
|
+
|
|
4
|
+
name: Houston Override
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
issue_comment:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
pull-requests: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
override:
|
|
15
|
+
if: >
|
|
16
|
+
github.event.issue.pull_request &&
|
|
17
|
+
contains(github.event.comment.body, '/houston approve')
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Dismiss BecarIA review and approve
|
|
21
|
+
uses: actions/github-script@v7
|
|
22
|
+
with:
|
|
23
|
+
script: |
|
|
24
|
+
const { owner, repo } = context.repo;
|
|
25
|
+
const pr_number = context.payload.issue.number;
|
|
26
|
+
|
|
27
|
+
// Find and dismiss becaria-reviewer reviews
|
|
28
|
+
const reviews = await github.rest.pulls.listReviews({
|
|
29
|
+
owner, repo, pull_number: pr_number
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
for (const review of reviews.data) {
|
|
33
|
+
if (review.user.login.includes('becaria-reviewer') && review.state === 'CHANGES_REQUESTED') {
|
|
34
|
+
await github.rest.pulls.dismissReview({
|
|
35
|
+
owner, repo, pull_number: pr_number, review_id: review.id,
|
|
36
|
+
message: `Dismissed by Houston Override (${context.payload.comment.user.login})`
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Approve the PR
|
|
42
|
+
await github.rest.pulls.createReview({
|
|
43
|
+
owner, repo, pull_number: pr_number,
|
|
44
|
+
event: 'APPROVE',
|
|
45
|
+
body: `Houston Override by @${context.payload.comment.user.login}`
|
|
46
|
+
});
|