@tutar/graph-engineering 0.3.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/LICENSE +21 -0
- package/README.md +10 -0
- package/bin/graph-engineering.mjs +60 -0
- package/lib/check.mjs +102 -0
- package/lib/constants.mjs +17 -0
- package/lib/files.mjs +83 -0
- package/lib/init.mjs +29 -0
- package/lib/manifest.mjs +31 -0
- package/lib/migrate.mjs +101 -0
- package/lib/package-assets.mjs +39 -0
- package/migrations/loop-engineering-927bd961/development/.github/loop-engineering/development-worktree.sh +32 -0
- package/migrations/loop-engineering-927bd961/development/.github/loop-engineering/github-development-ticket.mjs +246 -0
- package/migrations/loop-engineering-927bd961/development/.github/loop-engineering/stop-hook-drain.mjs +20 -0
- package/migrations/loop-engineering-927bd961/development/.github/loop-engineering/thread-record.mjs +36 -0
- package/migrations/loop-engineering-927bd961/development/.github/workflows/github-development-ticket.yml +124 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/capture-review.mjs +16 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/check-publication.mjs +23 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/codex-compatibility-profile.json +67 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/codex-compatible-executor.mjs +130 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/github-api.mjs +20 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/pr-review-case.mjs +125 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/pr-review-config.json +19 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/pr-review-contract.mjs +2 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/prepare-review.mjs +50 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/publish-review.mjs +103 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/review-result.schema.json +93 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/loop-engineering/route-review.mjs +117 -0
- package/migrations/loop-engineering-927bd961/pr-review/.github/workflows/github-pr-review.yml +138 -0
- package/package.json +38 -0
- package/release-metadata.json +4 -0
- package/templates/development/.github/graph-engineering/development-worktree.sh +47 -0
- package/templates/development/.github/graph-engineering/github-development-ticket.mjs +246 -0
- package/templates/development/.github/graph-engineering/stop-hook-drain.mjs +20 -0
- package/templates/development/.github/graph-engineering/thread-record.mjs +39 -0
- package/templates/development/.github/workflows/github-development-ticket.yml +124 -0
- package/templates/pr-review/.github/graph-engineering/capture-review.mjs +16 -0
- package/templates/pr-review/.github/graph-engineering/check-publication.mjs +23 -0
- package/templates/pr-review/.github/graph-engineering/codex-compatibility-profile.json +67 -0
- package/templates/pr-review/.github/graph-engineering/codex-compatible-executor.mjs +130 -0
- package/templates/pr-review/.github/graph-engineering/github-api.mjs +20 -0
- package/templates/pr-review/.github/graph-engineering/pr-review-case.mjs +125 -0
- package/templates/pr-review/.github/graph-engineering/pr-review-config.json +19 -0
- package/templates/pr-review/.github/graph-engineering/pr-review-contract.mjs +2 -0
- package/templates/pr-review/.github/graph-engineering/prepare-review.mjs +50 -0
- package/templates/pr-review/.github/graph-engineering/publish-review.mjs +103 -0
- package/templates/pr-review/.github/graph-engineering/review-result.schema.json +93 -0
- package/templates/pr-review/.github/graph-engineering/route-review.mjs +117 -0
- package/templates/pr-review/.github/workflows/github-pr-review.yml +138 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
name: Graph Engineering PR Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, synchronize, ready_for_review]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
pull_request_number:
|
|
9
|
+
description: Pull request number to review
|
|
10
|
+
required: true
|
|
11
|
+
type: number
|
|
12
|
+
event_prompt:
|
|
13
|
+
description: Review objective placed at the start of the Goal Prompt
|
|
14
|
+
required: false
|
|
15
|
+
default: Review this change against the repository rules and its requested behavior.
|
|
16
|
+
type: string
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: ${{ github.repository }}:pull-request:${{ github.event.pull_request.number || inputs.pull_request_number }}
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
route:
|
|
24
|
+
runs-on: ubuntu-24.04
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
pull-requests: read
|
|
28
|
+
outputs:
|
|
29
|
+
should_start: ${{ steps.route.outputs.should_start }}
|
|
30
|
+
pull_request_number: ${{ steps.route.outputs.pull_request_number }}
|
|
31
|
+
event_prompt: ${{ steps.route.outputs.event_prompt }}
|
|
32
|
+
codex_model: ${{ steps.route.outputs.codex_model }}
|
|
33
|
+
codex_effort: ${{ steps.route.outputs.codex_effort }}
|
|
34
|
+
safety_strategy: ${{ steps.route.outputs.safety_strategy }}
|
|
35
|
+
steps:
|
|
36
|
+
- name: Check out the trusted router
|
|
37
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
38
|
+
with:
|
|
39
|
+
ref: ${{ github.event.repository.default_branch }}
|
|
40
|
+
persist-credentials: false
|
|
41
|
+
- name: Route the GitHub Event
|
|
42
|
+
id: route
|
|
43
|
+
env:
|
|
44
|
+
GH_TOKEN: ${{ github.token }}
|
|
45
|
+
run: node .github/graph-engineering/route-review.mjs
|
|
46
|
+
|
|
47
|
+
review:
|
|
48
|
+
needs: route
|
|
49
|
+
if: >-
|
|
50
|
+
needs.route.outputs.should_start == 'true' &&
|
|
51
|
+
(github.event_name != 'workflow_dispatch' ||
|
|
52
|
+
github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
|
|
53
|
+
runs-on: [self-hosted, Linux, X64, codex]
|
|
54
|
+
permissions:
|
|
55
|
+
contents: read
|
|
56
|
+
pull-requests: read
|
|
57
|
+
checks: read
|
|
58
|
+
steps:
|
|
59
|
+
- name: Check out the trusted review control plane
|
|
60
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
61
|
+
with:
|
|
62
|
+
ref: ${{ github.event.repository.default_branch }}
|
|
63
|
+
path: .graph-engineering-trusted
|
|
64
|
+
persist-credentials: false
|
|
65
|
+
- name: Read trusted PR facts and form the Goal Prompt
|
|
66
|
+
id: target
|
|
67
|
+
env:
|
|
68
|
+
GH_TOKEN: ${{ github.token }}
|
|
69
|
+
PULL_REQUEST_NUMBER: ${{ needs.route.outputs.pull_request_number }}
|
|
70
|
+
EVENT_PROMPT: ${{ needs.route.outputs.event_prompt }}
|
|
71
|
+
run: node .graph-engineering-trusted/.github/graph-engineering/prepare-review.mjs
|
|
72
|
+
- name: Check out the trusted PR target
|
|
73
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
74
|
+
with:
|
|
75
|
+
ref: ${{ steps.target.outputs.head_sha }}
|
|
76
|
+
path: review-workspace
|
|
77
|
+
fetch-depth: 0
|
|
78
|
+
persist-credentials: false
|
|
79
|
+
- name: Run the Codex Compatible Executor
|
|
80
|
+
id: codex
|
|
81
|
+
continue-on-error: true
|
|
82
|
+
uses: tutar/codex-action@f33581290086e62dc34d420a7f1862477fc2b503 # maintained runner-login patch
|
|
83
|
+
with:
|
|
84
|
+
prompt-file: ${{ github.workspace }}/pr-review-goal.md
|
|
85
|
+
output-schema-file: ${{ github.workspace }}/.graph-engineering-trusted/.github/graph-engineering/review-result.schema.json
|
|
86
|
+
working-directory: ${{ github.workspace }}/review-workspace
|
|
87
|
+
codex-version: 0.153.4
|
|
88
|
+
model: ${{ needs.route.outputs.codex_model }}
|
|
89
|
+
effort: ${{ needs.route.outputs.codex_effort }}
|
|
90
|
+
safety-strategy: ${{ needs.route.outputs.safety_strategy }}
|
|
91
|
+
- name: Map the Action terminal and final-message
|
|
92
|
+
if: always()
|
|
93
|
+
env:
|
|
94
|
+
ACTION_OUTCOME: ${{ steps.codex.outcome }}
|
|
95
|
+
FINAL_MESSAGE: ${{ steps.codex.outputs.final-message }}
|
|
96
|
+
TRUSTED_TARGET: ${{ steps.target.outputs.target_json }}
|
|
97
|
+
run: node .graph-engineering-trusted/.github/graph-engineering/capture-review.mjs
|
|
98
|
+
- name: Preserve the trusted target and candidate Review Result
|
|
99
|
+
if: always()
|
|
100
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
101
|
+
with:
|
|
102
|
+
name: pr-review-result
|
|
103
|
+
path: |
|
|
104
|
+
pr-review-target.json
|
|
105
|
+
pr-review-context.md
|
|
106
|
+
review-execution.json
|
|
107
|
+
review-result.json
|
|
108
|
+
if-no-files-found: error
|
|
109
|
+
|
|
110
|
+
publish:
|
|
111
|
+
needs: [route, review]
|
|
112
|
+
if: >-
|
|
113
|
+
always() &&
|
|
114
|
+
needs.route.result == 'success' &&
|
|
115
|
+
needs.route.outputs.should_start == 'true'
|
|
116
|
+
runs-on: ubuntu-24.04
|
|
117
|
+
permissions:
|
|
118
|
+
contents: read
|
|
119
|
+
pull-requests: read
|
|
120
|
+
checks: write
|
|
121
|
+
steps:
|
|
122
|
+
- name: Check out the trusted publisher
|
|
123
|
+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
124
|
+
with:
|
|
125
|
+
ref: ${{ github.event.repository.default_branch }}
|
|
126
|
+
path: .graph-engineering-publisher
|
|
127
|
+
persist-credentials: false
|
|
128
|
+
- name: Download the candidate Review Result
|
|
129
|
+
continue-on-error: true
|
|
130
|
+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
|
131
|
+
with:
|
|
132
|
+
name: pr-review-result
|
|
133
|
+
path: pr-review-artifact
|
|
134
|
+
- name: Validate and publish the Check Run
|
|
135
|
+
env:
|
|
136
|
+
GH_TOKEN: ${{ github.token }}
|
|
137
|
+
UPSTREAM_RESULT: ${{ needs.review.result }}
|
|
138
|
+
run: node .graph-engineering-publisher/.github/graph-engineering/publish-review.mjs
|