Skip to content

Commit 462e24c

Browse files
committed
AI: update work workflow - no manual reviews anymore
1 parent 522a126 commit 462e24c

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

@@ -115,7 +120,7 @@ pm-flow-update-inner rev='@':
115120
jj new -r {{rev}} -m "Updating Issue database"
116121
UPDATE_CHANGE=`jj log -r @ --template 'change_id' --no-graph`
117122

118-
echo "$INSTRUCTIONS_2" | codex exec --full-auto --config model_reasoning_effort=high
123+
echo "$INSTRUCTIONS_2" | {{codex}}
119124

120125

121126
next-issue workspace_id: (run workspace_id "next-issue" "next-issue-inner")
@@ -124,7 +129,7 @@ next-issue-inner:
124129
#!/usr/bin/env sh
125130
[ -f next-issue.md ] || exit 1
126131

127-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
132+
{{codex}} <<EOF
128133
1. You will next work on issue `cat next-issue.md`. Read the actual issue from 'issues.md'
129134
3. Decide is it relevant to write a failing test for the issue. If so, write the test, make sure that it fails.
130135
Note! Not all issues require writing failing tests. Use discretion. Remember - code is debt.
@@ -154,7 +159,7 @@ review-change workspace_id: (run workspace_id "review-change" "review-change-inn
154159

155160
review-change-inner:
156161
#!/usr/bin/env sh
157-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
162+
{{codex}} <<EOF
158163
1. Fetch the current changes by writing 'jj show'
159164
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"'
160165
3. Do a deep review of the change.
@@ -186,7 +191,7 @@ tidy-issues workspace_id: (run workspace_id "tidy-issues" "tidy-issues-inner")
186191

187192
tidy-issues-inner:
188193
#!/usr/bin/env sh
189-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
194+
{{codex}} <<EOF
190195
1. Read the file '/issues.md'.
191196
2. Check if it follows the rules listed below
192197
3. run 'jj new -m "issues(codex): ..."'. For example 'jj new -m "issues(codex): Removing duplicate dog-barking issue"'
@@ -202,7 +207,7 @@ archive-issues workspace_id: (run workspace_id "archive-issues" "archive-issues-
202207

203208
archive-issues-inner:
204209
#!/usr/bin/env sh
205-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
210+
{{codex}} <<EOF
206211
This is a task to archive done issues.
207212
1. Read file '/issues.md'.
208213
2. Check if there are any issues which are DONE. If not, exit.
@@ -215,7 +220,7 @@ pick-next-issue workspace_id: (run workspace_id "pick-next-issue" "pick-next-iss
215220

216221
pick-next-issue-inner:
217222
#!/usr/bin/env sh
218-
codex exec --full-auto --config model_reasoning_effort=high <<EOF
223+
{{codex}} <<EOF
219224
1. Examine issues.md and choose a single issue to work on.
220225
2. If no issue is chosen, then STOP and don''t do anything else.
221226
3. Otherwise:
@@ -257,15 +262,21 @@ ai-work-step-inner:
257262
{{workspace_just}} review-change-inner
258263

259264
# Use this step when starting to work on a new issue
260-
work workspace_id: (run workspace_id "work" "work-inner")
265+
work workspace_id rev="@": (run workspace_id "work" "work-inner" rev)
261266

262-
work-inner:
267+
work-inner rev:
263268
#!/usr/bin/env sh
269+
echo AAAA: `pwd`
270+
271+
jj edit {{rev}}
264272
while true; do
273+
{{workspace_just}} questions-for-pm-inner
265274
{{workspace_just}} pick-next-issue-inner
266275
[ -f next-issue.md ] || break
267276
{{workspace_just}} ai-work-step-inner
268-
{{workspace_just}} human-work-step-inner
277+
jj split issues.md -m "issues: Update after review"
278+
jj edit @-
279+
#{{workspace_just}} human-work-step-inner
269280
done
270281

271282
# This should be started if you stop at editor phase and want to continue from where you left off
@@ -281,3 +292,5 @@ continue-work-inner:
281292
{{workspace_just}} ai-work-step-inner
282293
done
283294

295+
test:
296+
echo `pwd`

0 commit comments

Comments
 (0)