Skip to content

Commit 31dd063

Browse files
committed
AI: update work workflow - no manual reviews anymore
1 parent 91ffe43 commit 31dd063

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

agents.just

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Runs the given task in a workspace
2+
3+
workspace_just := "just -d . --justfile .agent-tools/agents.just"
4+
25
[private]
36
run workspace_id workflow inner_workflow *ARGS:
4-
bash scripts/agent-workspace.sh run {{workspace_id}} --workflow {{workflow}} -- just --justfile .agent-tools/agents.just --set workspace_id {{workspace_id}} {{inner_workflow}} {{ARGS}}
7+
bash scripts/agent-workspace.sh run {{workspace_id}} --workflow {{workflow}} -- {{workspace_just}} {{inner_workflow}} {{ARGS}}
8+
59

6-
workspace_just := "just --justfile .agent-tools/agents.just"
10+
codex := "codex exec --skip-git-repo-check --full-auto --config model_reasoning_effort=high"
711

812
consolidate workspace_id start_change_id end_change_id: (run workspace_id "consolidate" "consolidate-inner" start_change_id end_change_id)
913

@@ -31,7 +35,7 @@ consolidate-inner start_change_id end_change_id:
3135

3236
jj new -r {{start_change_id}} -m "Consolidation in progress"
3337

34-
echo "$INSTRUCTIONS" | codex exec --skip-git-repo-check --full-auto --config model_reasoning_effort=high
38+
echo "$INSTRUCTIONS" | {{codex}}
3539

3640
workspace-status workspace_id='':
3741
@if [ -z "{{workspace_id}}" ]; then \
@@ -49,11 +53,12 @@ workspace-clean workspace_id:
4953
workspace-sync-tools workspace_id:
5054
scripts/agent-workspace.sh sync-tools {{workspace_id}}
5155

52-
questions-for-pm workspace_id rev='@': (run {{workspace_id}} "questions-for-pm" "questions-for-pm-inner" rev)
56+
questions-for-pm workspace_id rev='@': (run workspace_id "questions-for-pm" "questions-for-pm-inner" rev)
5357

5458
questions-for-pm-inner rev='@':
5559
#!/usr/bin/env sh
5660
CURRENT_CHANGE=`jj log -r @ --template 'change_id' --no-graph`
61+
echo BBBB: `pwd`
5762

5863
read -r -d '' INSTRUCTIONS_1 <<-EOF
5964
1. Read the current state of open issues in issues.md
@@ -76,13 +81,13 @@ questions-for-pm-inner rev='@':
7681
while true; do
7782
PREV_HASH=`[ -f pm-faq.md ] && sha256sum pm-faq.md | cut -d' ' -f1 || echo ""`
7883

79-
echo "$INSTRUCTIONS_1" | codex exec --full-auto --config model_reasoning_effort=high
84+
echo "$INSTRUCTIONS_1" | {{codex}}
8085

8186
CURR_HASH=`[ -f pm-faq.md ] && sha256sum pm-faq.md | cut -d' ' -f1 || echo ""`
8287
[ "$CURR_HASH" = "$PREV_HASH" ] && break
8388

8489
# Optional manual edits
85-
jj edit $CURRENT_CHANGE && just --justfile .agent-tools/agents.just --set workspace_id {{workspace_id}} edit-inner $PM_CHANGE
90+
jj edit $CURRENT_CHANGE && {{workspace_just}} edit-inner $PM_CHANGE
8691
# Update issues based on PM responses
8792
{{workspace_just}} pm-flow-update-inner $PM_CHANGE
8893

@@ -121,7 +126,7 @@ pm-flow-update-inner rev='@':
121126
jj new -r {{rev}} -m "Updating Issue database"
122127
UPDATE_CHANGE=`jj log -r @ --template 'change_id' --no-graph`
123128
124-
echo "$INSTRUCTIONS_2" | codex exec --full-auto --config model_reasoning_effort=high
129+
echo "$INSTRUCTIONS_2" | {{codex}}
125130
126131
127132
next-issue workspace_id: (run workspace_id "next-issue" "next-issue-inner")
@@ -130,7 +135,7 @@ next-issue-inner:
130135
#!/usr/bin/env sh
131136
[ -f next-issue.md ] || exit 1
132137
133-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
138+
{{codex}} <<EOF
134139
1. You will next work on issue `cat next-issue.md`. Read the actual issue from 'issues.md'
135140
3. Decide is it relevant to write a failing test for the issue. If so, write the test, make sure that it fails.
136141
Note! Not all issues require writing failing tests. Use discretion. Remember - code is debt.
@@ -160,7 +165,7 @@ review-change workspace_id: (run workspace_id "review-change" "review-change-inn
160165
161166
review-change-inner:
162167
#!/usr/bin/env sh
163-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
168+
{{codex}} <<EOF
164169
1. Fetch the current changes by writing 'jj show'
165170
2. Create a new change by calling 'jj new -m "review(codex): ..."'. For example 'jj new -m "review(codex): Issue 004 - introducing dog barking functionality"'
166171
3. Do a deep review of the change.
@@ -192,7 +197,7 @@ tidy-issues workspace_id: (run workspace_id "tidy-issues" "tidy-issues-inner")
192197

193198
tidy-issues-inner:
194199
#!/usr/bin/env sh
195-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
200+
{{codex}} <<EOF
196201
1. Read the file '/issues.md'.
197202
2. Check if it follows the rules listed below
198203
3. run 'jj new -m "issues(codex): ..."'. For example 'jj new -m "issues(codex): Removing duplicate dog-barking issue"'
@@ -208,7 +213,7 @@ archive-issues workspace_id: (run workspace_id "archive-issues" "archive-issues-
208213

209214
archive-issues-inner:
210215
#!/usr/bin/env sh
211-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
216+
{{codex}} <<EOF
212217
This is a task to archive done issues.
213218
1. Read file '/issues.md'.
214219
2. Check if there are any issues which are DONE. If not, exit.
@@ -221,7 +226,7 @@ pick-next-issue workspace_id: (run workspace_id "pick-next-issue" "pick-next-iss
221226

222227
pick-next-issue-inner:
223228
#!/usr/bin/env sh
224-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
229+
{{codex}} <<EOF
225230
1. Examine issues.md and choose a single issue to work on.
226231
2. If no issue is chosen, then STOP and don''t do anything else.
227232
3. Otherwise:
@@ -263,15 +268,21 @@ ai-work-step-inner:
263268
{{workspace_just}} review-change-inner
264269

265270
# Use this step when starting to work on a new issue
266-
work workspace_id: (run workspace_id "work" "work-inner")
271+
work workspace_id rev="@": (run workspace_id "work" "work-inner" rev)
267272

268-
work-inner:
273+
work-inner rev:
269274
#!/usr/bin/env sh
275+
echo AAAA: `pwd`
276+
277+
jj edit {{rev}}
270278
while true; do
279+
{{workspace_just}} questions-for-pm-inner
271280
{{workspace_just}} pick-next-issue-inner
272281
[ -f next-issue.md ] || break
273282
{{workspace_just}} ai-work-step-inner
274-
{{workspace_just}} human-work-step-inner
283+
jj split issues.md -m "issues: Update after review"
284+
jj edit @-
285+
#{{workspace_just}} human-work-step-inner
275286
done
276287

277288
# This should be started if you stop at editor phase and want to continue from where you left off
@@ -287,3 +298,5 @@ continue-work-inner:
287298
{{workspace_just}} ai-work-step-inner
288299
done
289300

301+
test:
302+
echo `pwd`

0 commit comments

Comments
 (0)