feat: Fixed graph agents with new agent variable passing functionality
This commit is contained in:
7 files changed
+40
-11
No files matched your search
@@ -33,6 +33,7 @@ settings:
|
|||||||
timeout: 5400
|
timeout: 5400
|
||||||
|
|
||||||
initial_state:
|
initial_state:
|
||||||
|
project_dir_in: ''
|
||||||
criteria: []
|
criteria: []
|
||||||
diff_spec: auto
|
diff_spec: auto
|
||||||
plan_notes: ''
|
plan_notes: ''
|
||||||
@@ -68,6 +69,8 @@ nodes:
|
|||||||
- `diff_spec`: the git diff basis the caller named — a range, a ref/SHA,
|
- `diff_spec`: the git diff basis the caller named — a range, a ref/SHA,
|
||||||
"staged", "worktree", or "auto" when unnamed (a caller phrase like
|
"staged", "worktree", or "auto" when unnamed (a caller phrase like
|
||||||
"get_diff --base X" means diff_spec = "X").
|
"get_diff --base X" means diff_spec = "X").
|
||||||
|
- `project_dir_in`: the directory/worktree path the caller named as
|
||||||
|
holding the code under review; empty string when the caller named none.
|
||||||
- `plan_notes`: recorded decisions the plan states ("do X not Y because Z"),
|
- `plan_notes`: recorded decisions the plan states ("do X not Y because Z"),
|
||||||
verbatim — the holistic pass checks the diff didn't silently override them.
|
verbatim — the holistic pass checks the diff didn't silently override them.
|
||||||
- `scope_notes`: what the plan says NOT to touch / explicit boundaries.
|
- `scope_notes`: what the plan says NOT to touch / explicit boundaries.
|
||||||
@@ -98,7 +101,9 @@ nodes:
|
|||||||
type: string
|
type: string
|
||||||
extra_context:
|
extra_context:
|
||||||
type: string
|
type: string
|
||||||
required: [criteria, diff_spec, plan_notes, scope_notes, extra_context]
|
project_dir_in:
|
||||||
|
type: string
|
||||||
|
required: [criteria, diff_spec, plan_notes, scope_notes, extra_context, project_dir_in]
|
||||||
max_iterations: 3
|
max_iterations: 3
|
||||||
max_attempts: 2
|
max_attempts: 2
|
||||||
next: facts
|
next: facts
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ def load_state():
|
|||||||
|
|
||||||
|
|
||||||
state = load_state()
|
state = load_state()
|
||||||
proj = state.get("project_dir") or "."
|
proj = os.path.expanduser(
|
||||||
|
(state.get("project_dir_in") or "").strip() or state.get("project_dir") or "."
|
||||||
|
)
|
||||||
spec = (state.get("diff_spec") or "auto").strip()
|
spec = (state.get("diff_spec") or "auto").strip()
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +35,7 @@ def git(*args):
|
|||||||
return r.stdout
|
return r.stdout
|
||||||
|
|
||||||
|
|
||||||
out = {"diff_note": ""}
|
out = {"diff_note": "", "project_dir": proj}
|
||||||
try:
|
try:
|
||||||
if spec in ("auto", ""):
|
if spec in ("auto", ""):
|
||||||
text = git("diff", "--cached")
|
text = git("diff", "--cached")
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ settings:
|
|||||||
timeout: 10800
|
timeout: 10800
|
||||||
|
|
||||||
initial_state:
|
initial_state:
|
||||||
|
project_dir_in: ''
|
||||||
diff_spec: auto
|
diff_spec: auto
|
||||||
intent: ''
|
intent: ''
|
||||||
rigor_in: ''
|
rigor_in: ''
|
||||||
@@ -111,6 +112,9 @@ nodes:
|
|||||||
- `rigor_in`: ONLY when the caller explicitly set a rigor (poc|prototype|production),
|
- `rigor_in`: ONLY when the caller explicitly set a rigor (poc|prototype|production),
|
||||||
e.g. via a "Quality bar:" line; else empty string.
|
e.g. via a "Quality bar:" line; else empty string.
|
||||||
- `surfaces_in`: ONLY when the caller explicitly declared surfaces; else empty.
|
- `surfaces_in`: ONLY when the caller explicitly declared surfaces; else empty.
|
||||||
|
- `project_dir_in`: the directory/worktree path the caller named as
|
||||||
|
holding the code under review (e.g. "in /tmp/pr-review-x", "the repo
|
||||||
|
at ~/code/foo"); empty string when the caller named none.
|
||||||
- `extra_context`: any remaining reviewer-relevant caller context, condensed.
|
- `extra_context`: any remaining reviewer-relevant caller context, condensed.
|
||||||
prompt: |
|
prompt: |
|
||||||
Extract the review-request facts from this request:
|
Extract the review-request facts from this request:
|
||||||
@@ -128,9 +132,11 @@ nodes:
|
|||||||
type: string
|
type: string
|
||||||
surfaces_in:
|
surfaces_in:
|
||||||
type: string
|
type: string
|
||||||
|
project_dir_in:
|
||||||
|
type: string
|
||||||
extra_context:
|
extra_context:
|
||||||
type: string
|
type: string
|
||||||
required: [diff_spec, intent, rigor_in, surfaces_in, extra_context]
|
required: [diff_spec, intent, rigor_in, surfaces_in, project_dir_in, extra_context]
|
||||||
max_iterations: 3
|
max_iterations: 3
|
||||||
max_attempts: 2
|
max_attempts: 2
|
||||||
next: facts
|
next: facts
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ def load_state():
|
|||||||
|
|
||||||
|
|
||||||
state = load_state()
|
state = load_state()
|
||||||
proj = state.get("project_dir") or "."
|
proj = os.path.expanduser(
|
||||||
|
(state.get("project_dir_in") or "").strip() or state.get("project_dir") or "."
|
||||||
|
)
|
||||||
spec = (state.get("diff_spec") or "auto").strip()
|
spec = (state.get("diff_spec") or "auto").strip()
|
||||||
notes = []
|
notes = []
|
||||||
out = {}
|
out = {"project_dir": proj}
|
||||||
|
|
||||||
|
|
||||||
def git(*args, timeout=60):
|
def git(*args, timeout=60):
|
||||||
|
|||||||
@@ -55,8 +55,12 @@ nodes:
|
|||||||
- `path` and `lines` come from the finding verbatim; if a finding cites
|
- `path` and `lines` come from the finding verbatim; if a finding cites
|
||||||
multiple locations, emit one entry per location with the same id plus
|
multiple locations, emit one entry per location with the same id plus
|
||||||
a `-b`, `-c` suffix.
|
a `-b`, `-c` suffix.
|
||||||
|
- `project_dir`: the repository directory named in the request (a
|
||||||
|
"Repository:" or "Project:" line). When none is named, echo the
|
||||||
|
default shown in the prompt.
|
||||||
prompt: |
|
prompt: |
|
||||||
Extract the findings from this verification request:
|
Extract the findings from this verification request (default repository
|
||||||
|
directory when the request names none: {{project_dir}}):
|
||||||
|
|
||||||
{{initial_prompt}}
|
{{initial_prompt}}
|
||||||
tools: []
|
tools: []
|
||||||
@@ -84,7 +88,10 @@ nodes:
|
|||||||
type: string
|
type: string
|
||||||
description: Self-contained statement of what the finding asserts about the code.
|
description: Self-contained statement of what the finding asserts about the code.
|
||||||
required: [id, severity, path, lines, claim]
|
required: [id, severity, path, lines, claim]
|
||||||
required: [findings_list]
|
project_dir:
|
||||||
|
type: string
|
||||||
|
description: Repository directory named in the request (echo the prompt default when none).
|
||||||
|
required: [findings_list, project_dir]
|
||||||
next: verify_each
|
next: verify_each
|
||||||
|
|
||||||
verify_each:
|
verify_each:
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ nodes:
|
|||||||
range ("main...HEAD", "HEAD~3..HEAD"), a single ref, or the literal
|
range ("main...HEAD", "HEAD~3..HEAD"), a single ref, or the literal
|
||||||
"worktree" for uncommitted changes against HEAD. When the caller
|
"worktree" for uncommitted changes against HEAD. When the caller
|
||||||
did not name one, use "worktree".
|
did not name one, use "worktree".
|
||||||
|
- `project_dir_in`: the repository directory the caller named as holding
|
||||||
|
the change (absolute path preferred); empty string when the caller
|
||||||
|
named none.
|
||||||
- `plan_context`: the plan / spec / acceptance-criteria text the
|
- `plan_context`: the plan / spec / acceptance-criteria text the
|
||||||
implementation must satisfy, verbatim (or a file path the caller
|
implementation must satisfy, verbatim (or a file path the caller
|
||||||
pointed at). Empty string when the caller supplied none.
|
pointed at). Empty string when the caller supplied none.
|
||||||
@@ -121,7 +124,9 @@ nodes:
|
|||||||
type: string
|
type: string
|
||||||
extra_context:
|
extra_context:
|
||||||
type: string
|
type: string
|
||||||
required: [diff_spec, plan_context, rigor, security_posture, probe_context, forced_lanes, extra_context]
|
project_dir_in:
|
||||||
|
type: string
|
||||||
|
required: [diff_spec, plan_context, rigor, security_posture, probe_context, forced_lanes, extra_context, project_dir_in]
|
||||||
max_iterations: 3
|
max_iterations: 3
|
||||||
max_attempts: 2
|
max_attempts: 2
|
||||||
next: signals
|
next: signals
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ def load_state():
|
|||||||
|
|
||||||
|
|
||||||
state = load_state()
|
state = load_state()
|
||||||
proj = state.get("project_dir") or "."
|
proj = os.path.expanduser(
|
||||||
|
(state.get("project_dir_in") or "").strip() or state.get("project_dir") or "."
|
||||||
|
)
|
||||||
spec = (state.get("diff_spec") or "worktree").strip()
|
spec = (state.get("diff_spec") or "worktree").strip()
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +36,7 @@ def git(*args):
|
|||||||
return r.stdout
|
return r.stdout
|
||||||
|
|
||||||
|
|
||||||
out = {}
|
out = {"project_dir": proj}
|
||||||
try:
|
try:
|
||||||
if spec in ("", "worktree"):
|
if spec in ("", "worktree"):
|
||||||
names = git("diff", "--name-only", "HEAD")
|
names = git("diff", "--name-only", "HEAD")
|
||||||
|
|||||||
Reference in new issue
Block a user