@open-agent-toolkit/cli 0.1.13 → 0.1.15
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/assets/agents/oat-reviewer.md +54 -10
- package/assets/docs/workflows/projects/reviews.md +21 -2
- package/assets/docs/workflows/skills/index.md +2 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-review-provide-remote/SKILL.md +354 -0
- package/assets/skills/oat-project-review-receive/SKILL.md +7 -10
- package/assets/skills/oat-project-review-receive-remote/SKILL.md +4 -4
- package/assets/skills/oat-review-provide/SKILL.md +2 -2
- package/assets/skills/oat-review-provide/scripts/resolve-review-output.sh +16 -6
- package/assets/skills/oat-review-provide-remote/SKILL.md +273 -0
- package/assets/skills/oat-review-receive/SKILL.md +6 -6
- package/assets/skills/oat-review-receive-remote/SKILL.md +5 -5
- package/dist/commands/init/tools/shared/skill-manifest.d.ts +2 -2
- package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
- package/dist/commands/init/tools/shared/skill-manifest.js +2 -0
- package/dist/commands/project/new/index.d.ts +1 -0
- package/dist/commands/project/new/index.d.ts.map +1 -1
- package/dist/commands/project/new/index.js +23 -0
- package/dist/commands/project/new/scaffold.d.ts +17 -0
- package/dist/commands/project/new/scaffold.d.ts.map +1 -1
- package/dist/commands/project/new/scaffold.js +74 -0
- package/dist/review-remote/body-builder.d.ts +79 -0
- package/dist/review-remote/body-builder.d.ts.map +1 -0
- package/dist/review-remote/body-builder.js +103 -0
- package/dist/review-remote/capability-probe.d.ts +61 -0
- package/dist/review-remote/capability-probe.d.ts.map +1 -0
- package/dist/review-remote/capability-probe.js +87 -0
- package/dist/review-remote/line-mapper.d.ts +81 -0
- package/dist/review-remote/line-mapper.d.ts.map +1 -0
- package/dist/review-remote/line-mapper.js +165 -0
- package/dist/review-remote/marker-parser.d.ts +44 -0
- package/dist/review-remote/marker-parser.d.ts.map +1 -0
- package/dist/review-remote/marker-parser.js +97 -0
- package/dist/review-remote/narrowing.d.ts +81 -0
- package/dist/review-remote/narrowing.d.ts.map +1 -0
- package/dist/review-remote/narrowing.js +90 -0
- package/dist/review-remote/project-resolver.d.ts +46 -0
- package/dist/review-remote/project-resolver.d.ts.map +1 -0
- package/dist/review-remote/project-resolver.js +60 -0
- package/dist/review-remote/reviewer-dispatch.d.ts +108 -0
- package/dist/review-remote/reviewer-dispatch.d.ts.map +1 -0
- package/dist/review-remote/reviewer-dispatch.js +153 -0
- package/dist/review-remote/worktree.d.ts +62 -0
- package/dist/review-remote/worktree.d.ts.map +1 -0
- package/dist/review-remote/worktree.js +117 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-review-receive-remote
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.4.0
|
|
4
4
|
description: Use when processing GitHub PR review comments within project context. Fetches PR comments, creates plan tasks, and updates project artifacts.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -139,11 +139,11 @@ Before prompting dispositions, print:
|
|
|
139
139
|
|
|
140
140
|
Disposition options:
|
|
141
141
|
|
|
142
|
-
- `convert` (default for critical/important/medium)
|
|
143
|
-
- `defer`
|
|
142
|
+
- `convert` (default for critical/important/medium/minor)
|
|
143
|
+
- `defer`
|
|
144
144
|
- `dismiss`
|
|
145
145
|
|
|
146
|
-
Require rationale for `defer`/`dismiss
|
|
146
|
+
Require concrete rationale for `defer`/`dismiss` at any severity, including minor. Small findings are usually cheaper to fix inline than to track as backlog items, so a minor `defer` must be justified just like any other deferral.
|
|
147
147
|
|
|
148
148
|
### Step 5: Convert Findings to Plan Tasks
|
|
149
149
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-review-provide
|
|
3
|
-
version: 1.2.
|
|
3
|
+
version: 1.2.1
|
|
4
4
|
description: Use when you need an ad-hoc review outside an active OAT project lifecycle. Reviews code or artifacts without project phase state, unlike oat-project-review-provide.
|
|
5
5
|
argument-hint: '[unstaged|staged|base_branch=<branch>|base_sha=<sha>|<sha1>..<sha2>|--files <path1,path2,...>] [--output <path>] [--mode auto|local|tracked|inline]'
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -137,7 +137,7 @@ bash .agents/skills/oat-review-provide/scripts/resolve-review-output.sh --mode a
|
|
|
137
137
|
|
|
138
138
|
Policy:
|
|
139
139
|
|
|
140
|
-
- If `.oat/repo/reviews` exists and
|
|
140
|
+
- If `.oat/repo/reviews` exists and new review artifacts under it are not gitignored, assume user wants tracked active artifacts there.
|
|
141
141
|
- Otherwise default to active local `.oat/projects/local/orphan-reviews`.
|
|
142
142
|
- Do **not** write new review artifacts directly into any `archived/` directory; those are historical locations used after `oat-review-receive` processes a review.
|
|
143
143
|
- If user preference is unclear, ask and recommend local-only.
|
|
@@ -18,7 +18,7 @@ Policy:
|
|
|
18
18
|
- If --output is provided, use it directly.
|
|
19
19
|
- If mode=inline, no artifact file is written.
|
|
20
20
|
- In auto mode:
|
|
21
|
-
- If .oat/repo/reviews exists and
|
|
21
|
+
- If .oat/repo/reviews exists and new review artifacts under it are NOT gitignored, use it (tracked convention).
|
|
22
22
|
- Otherwise, use .oat/projects/local/orphan-reviews (local-only default).
|
|
23
23
|
USAGE
|
|
24
24
|
}
|
|
@@ -67,12 +67,22 @@ is_gitignored() {
|
|
|
67
67
|
fi
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
artifact_probe_path() {
|
|
71
|
+
local output_dir="$1"
|
|
72
|
+
printf '%s/%s\n' "${output_dir%/}" "ad-hoc-review-gitignore-probe.md"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
is_output_gitignored() {
|
|
76
|
+
local output_dir="$1"
|
|
77
|
+
is_gitignored "$(artifact_probe_path "$output_dir")"
|
|
78
|
+
}
|
|
79
|
+
|
|
70
80
|
# Resolve explicit output first
|
|
71
81
|
if [[ -n "$OUTPUT" ]]; then
|
|
72
82
|
echo "review_mode=file"
|
|
73
83
|
echo "output_dir=$OUTPUT"
|
|
74
84
|
echo "output_kind=custom"
|
|
75
|
-
echo "output_gitignored=$(
|
|
85
|
+
echo "output_gitignored=$(is_output_gitignored "$OUTPUT")"
|
|
76
86
|
echo "reason=explicit_output"
|
|
77
87
|
exit 0
|
|
78
88
|
fi
|
|
@@ -93,7 +103,7 @@ if [[ "$MODE" == "tracked" ]]; then
|
|
|
93
103
|
echo "review_mode=file"
|
|
94
104
|
echo "output_dir=$TRACKED_DIR"
|
|
95
105
|
echo "output_kind=tracked"
|
|
96
|
-
echo "output_gitignored=$(
|
|
106
|
+
echo "output_gitignored=$(is_output_gitignored "$TRACKED_DIR")"
|
|
97
107
|
echo "reason=forced_tracked"
|
|
98
108
|
exit 0
|
|
99
109
|
fi
|
|
@@ -102,13 +112,13 @@ if [[ "$MODE" == "local" ]]; then
|
|
|
102
112
|
echo "review_mode=file"
|
|
103
113
|
echo "output_dir=$LOCAL_DIR"
|
|
104
114
|
echo "output_kind=local"
|
|
105
|
-
echo "output_gitignored=$(
|
|
115
|
+
echo "output_gitignored=$(is_output_gitignored "$LOCAL_DIR")"
|
|
106
116
|
echo "reason=forced_local"
|
|
107
117
|
exit 0
|
|
108
118
|
fi
|
|
109
119
|
|
|
110
120
|
# auto mode
|
|
111
|
-
if [[ -d "$TRACKED_DIR" ]] && [[ "$(
|
|
121
|
+
if [[ -d "$TRACKED_DIR" ]] && [[ "$(is_output_gitignored "$TRACKED_DIR")" == "false" ]]; then
|
|
112
122
|
echo "review_mode=file"
|
|
113
123
|
echo "output_dir=$TRACKED_DIR"
|
|
114
124
|
echo "output_kind=tracked"
|
|
@@ -120,5 +130,5 @@ fi
|
|
|
120
130
|
echo "review_mode=file"
|
|
121
131
|
echo "output_dir=$LOCAL_DIR"
|
|
122
132
|
echo "output_kind=local"
|
|
123
|
-
echo "output_gitignored=$(
|
|
133
|
+
echo "output_gitignored=$(is_output_gitignored "$LOCAL_DIR")"
|
|
124
134
|
echo "reason=default_local_only"
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oat-review-provide-remote
|
|
3
|
+
version: 1.0.3
|
|
4
|
+
description: Use when reviewing a GitHub PR opened on another machine and posting findings back as a single PR review, outside any OAT project context. Fetches the PR via gh, reviews it, and posts via gh api.
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
user-invocable: true
|
|
7
|
+
allowed-tools: Read, Write, Bash, Glob, Grep, AskUserQuestion
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Remote Review Provide (Ad-hoc GitHub PR)
|
|
11
|
+
|
|
12
|
+
Review a GitHub PR opened by an agent on another machine and post the findings back as a single GitHub PR review — without requiring an active OAT project. GitHub is the source of truth: no local artifact is written and no lifecycle bookkeeping happens here. The posted review carries metadata markers so `oat-review-receive-remote` can round-trip the findings into tasks on the originating machine.
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- `gh` CLI is installed and authenticated (`gh auth status`).
|
|
17
|
+
- The PR to review exists on GitHub and is reachable from the current repo's remote.
|
|
18
|
+
- Optionally `npx agent-reviews` for posting symmetry (capability-probed at startup; `gh api` is the fallback).
|
|
19
|
+
- User wants an ad-hoc remote review outside the OAT project lifecycle.
|
|
20
|
+
|
|
21
|
+
## Mode Assertion
|
|
22
|
+
|
|
23
|
+
**OAT MODE: Remote Review Provide**
|
|
24
|
+
|
|
25
|
+
**Purpose:** Fetch a GitHub PR, review it inline against the ad-hoc review checklist + severity model, and post a single PR review (summary + severity counts + inline comments + metadata markers) back to GitHub.
|
|
26
|
+
|
|
27
|
+
**BLOCKED Activities:**
|
|
28
|
+
|
|
29
|
+
- No `plan.md`, `state.md`, or `implementation.md` lifecycle mutations.
|
|
30
|
+
- No local review artifact written on this machine (GitHub is the source of truth).
|
|
31
|
+
- No mutation of the caller's working tree — all checkout happens in an ephemeral worktree.
|
|
32
|
+
- No implementing fixes, commits, or pushes (this skill reviews; it does not fix).
|
|
33
|
+
- No posting a review to GitHub without explicit user confirmation.
|
|
34
|
+
|
|
35
|
+
**ALLOWED Activities:**
|
|
36
|
+
|
|
37
|
+
- Resolve the PR number.
|
|
38
|
+
- Acquire PR content via ephemeral worktree + `gh pr checkout` (or `gh pr diff` fallback).
|
|
39
|
+
- Detect prior provide-remote reviews and narrow re-review scope (with the stale-SHA guard).
|
|
40
|
+
- Run the ad-hoc review inline (no tier model).
|
|
41
|
+
- Build the posted-review body + inline-comment array.
|
|
42
|
+
- Post a single PR review via `agent-reviews` (if probed supported) else `gh api` (with user confirmation).
|
|
43
|
+
|
|
44
|
+
**Self-Correction Protocol:**
|
|
45
|
+
If you catch yourself:
|
|
46
|
+
|
|
47
|
+
- Running `gh pr checkout` in the caller's working tree instead of an ephemeral worktree -> STOP, acquire the worktree first, and check out inside it.
|
|
48
|
+
- Writing a review artifact file on this machine -> STOP; the posted PR review is the only output.
|
|
49
|
+
- Editing project lifecycle artifacts (`plan.md`, `state.md`, `implementation.md`) -> STOP and revert to review-and-post only.
|
|
50
|
+
- Posting the review to GitHub without explicit user confirmation -> STOP and present the body + verdict for approval first.
|
|
51
|
+
- Narrowing against a prior review SHA without running the existence + ancestry guard -> STOP and run the guard first.
|
|
52
|
+
- Forgetting to remove the ephemeral worktree after posting (or on failure) -> STOP and release it in a `finally`.
|
|
53
|
+
|
|
54
|
+
## Progress Indicators (User-Facing)
|
|
55
|
+
|
|
56
|
+
Print this banner once at start:
|
|
57
|
+
|
|
58
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
59
|
+
OAT ▸ REMOTE REVIEW PROVIDE
|
|
60
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
61
|
+
|
|
62
|
+
Use step indicators:
|
|
63
|
+
|
|
64
|
+
- `[1/7] Resolving PR...`
|
|
65
|
+
- `[2/7] Checking out PR (ephemeral worktree)...`
|
|
66
|
+
- `[3/7] Detecting prior reviews + narrowing scope...`
|
|
67
|
+
- `[4/7] Running review...`
|
|
68
|
+
- `[5/7] Mapping inline comments to the diff...`
|
|
69
|
+
- `[6/7] Building review body + verdict...`
|
|
70
|
+
- `[7/7] Posting review + cleanup...`
|
|
71
|
+
|
|
72
|
+
## Arguments
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
oat-review-provide-remote [--pr <N>] [--no-checkout] [--narrow|--no-narrow]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- `--pr <N>`: target PR number. When omitted, auto-detect from the current branch.
|
|
79
|
+
- `--no-checkout`: skip the ephemeral worktree and review from `gh pr diff` only (degraded context).
|
|
80
|
+
- `--narrow` / `--no-narrow`: force or forbid re-review narrowing against a prior provide-remote review. When neither is passed, honor `workflow.autoNarrowReReviewScope` (no prompt when `true`; confirm prompt otherwise).
|
|
81
|
+
|
|
82
|
+
Inputs are CLI-style args parsed from `$ARGUMENTS`. No file inputs. No file outputs on this machine.
|
|
83
|
+
|
|
84
|
+
## Findings Model
|
|
85
|
+
|
|
86
|
+
Normalize every finding to this shape (matches the ad-hoc review checklist and the `oat-review-receive-remote` model):
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
finding:
|
|
90
|
+
id: "C1" | "I1" | "M1" | "m1"
|
|
91
|
+
severity: critical | important | medium | minor
|
|
92
|
+
title: string
|
|
93
|
+
file: string | null
|
|
94
|
+
line: number | null
|
|
95
|
+
body: string
|
|
96
|
+
fix_guidance: string | null
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Severity conventions:
|
|
100
|
+
|
|
101
|
+
- `critical`: Broken behavior, security risk, or missing P0 requirement.
|
|
102
|
+
- `important`: Missing P1 requirement, major robustness issue.
|
|
103
|
+
- `medium`: Meaningful but non-blocking quality/maintainability issue.
|
|
104
|
+
- `minor`: Cosmetic/style/documentation issue.
|
|
105
|
+
|
|
106
|
+
Checklist + severity model source of truth: `.agents/skills/oat-review-provide/references/review-artifact-template.md`.
|
|
107
|
+
|
|
108
|
+
## Process
|
|
109
|
+
|
|
110
|
+
### Step 1: Resolve PR Number
|
|
111
|
+
|
|
112
|
+
PR resolution order:
|
|
113
|
+
|
|
114
|
+
1. `--pr <N>` from `$ARGUMENTS`.
|
|
115
|
+
2. Auto-detect from the current branch: `gh pr view --json number -q .number`.
|
|
116
|
+
|
|
117
|
+
Confirm `gh auth status` succeeds. Ask the user to confirm the resolved PR number before checkout. Capture the PR HEAD SHA (full 40-char) for the marker block and the narrowing guard:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
PR_HEAD_SHA=$(gh pr view "$PR" --json headRefOid -q .headRefOid)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Step 2: Check Out the PR (Hybrid Read)
|
|
124
|
+
|
|
125
|
+
Acquire an ephemeral worktree FIRST, then run `gh pr checkout` inside it so the caller's working tree is never mutated. Use repo-scoped git commands so the skill works regardless of the caller's CWD (design.md → Data Flow step 2). This shell flow parallels the tested TypeScript helper at `packages/cli/src/review-remote/worktree.ts` (`acquireWorktree` / `runInWorktree` / `releaseWorktree`) — keep the two in sync if you change either:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
129
|
+
EPHEMERAL_PATH=$(mktemp -d)
|
|
130
|
+
rmdir "$EPHEMERAL_PATH" # git worktree add requires a non-existent target
|
|
131
|
+
git -C "$REPO_ROOT" worktree add --detach "$EPHEMERAL_PATH" HEAD
|
|
132
|
+
( cd "$EPHEMERAL_PATH" && gh pr checkout "$PR" )
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The `-C "$REPO_ROOT"` flag is load-bearing — it lets the command run even when the caller's CWD is not inside the repository.
|
|
136
|
+
|
|
137
|
+
Fallback to diff-only mode when `--no-checkout` is set, or when worktree creation / `gh pr checkout` fails (capture exit code + stderr; distinguish auth from network from branch-state failures). On checkout failure, clean up the partial worktree (`git -C "$REPO_ROOT" worktree remove --force "$EPHEMERAL_PATH"`), then warn the user that context is degraded and continue with:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
gh pr diff "$PR" > "$DIFF_FILE"
|
|
141
|
+
gh pr view "$PR" --json title,body,headRefOid,baseRefName,state
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Step 3: Detect Prior Reviews + Narrow Scope
|
|
145
|
+
|
|
146
|
+
List prior PR reviews and parse each body's marker block. Filter to reviews where `oat_provide_remote: true` AND `oat_review_scope == "ad-hoc"` AND no `oat_project` key — project-rail markers are ignored by the ad-hoc filter.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
gh api "/repos/{owner}/{repo}/pulls/$PR/reviews"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Take the most recent matching review (by submitted timestamp). Before narrowing to `<prior_sha>..<HEAD>`, run the stale-SHA guard (design.md → Error Handling → Stale prior-review SHA):
|
|
153
|
+
|
|
154
|
+
Run the guard in the available git context `$GIT_CTX` — `$EPHEMERAL_PATH` in rich-context (checkout) mode, or `$REPO_ROOT` in diff-only mode (where no worktree exists):
|
|
155
|
+
|
|
156
|
+
1. **Existence:** `git -C "$GIT_CTX" cat-file -e <prior_sha>` (diff-only mode: `git -C "$REPO_ROOT" fetch origin <prior_sha>:refs/oat-prior-review` first, then re-check; if that fetch fails, fall back to full PR scope).
|
|
157
|
+
2. **Ancestry:** `git -C "$GIT_CTX" merge-base --is-ancestor <prior_sha> "$PR_HEAD_SHA"`.
|
|
158
|
+
|
|
159
|
+
Guard outcomes:
|
|
160
|
+
|
|
161
|
+
- Both pass -> narrow to `<prior_sha>..<HEAD>`.
|
|
162
|
+
- Either fails -> fall back to full PR scope and warn that the prior SHA is unreachable (likely rebase/force-push).
|
|
163
|
+
- `--narrow` set AND guard fails -> hard error; surface unreachability and stop.
|
|
164
|
+
- `workflow.autoNarrowReReviewScope == true` -> never prompt; guard failure auto-falls back to full scope with the warning as the auto-fallback notice.
|
|
165
|
+
- No matching prior review -> use full PR diff.
|
|
166
|
+
|
|
167
|
+
### Step 4: Run the Review (Inline)
|
|
168
|
+
|
|
169
|
+
Review inline (no tier model — matches local `oat-review-provide`) using the ad-hoc review checklist + severity model. Scope to the narrowing range when one was chosen; otherwise the full PR diff. Assign finding IDs per severity bucket (`C1`, `I1`, `M1`, `m1`).
|
|
170
|
+
|
|
171
|
+
### Step 5: Map Inline Comments to the Diff
|
|
172
|
+
|
|
173
|
+
For each finding with non-null `file` + `line`, classify it against the PR diff BEFORE adding it to the inline `comments[]` payload (design.md → Error Handling → Inline-comment line mapping):
|
|
174
|
+
|
|
175
|
+
- Rich-context mode: parse hunk ranges from `gh api /repos/{owner}/{repo}/pulls/$PR/files` (per-file `patch` field).
|
|
176
|
+
- Diff-only mode: parse hunk headers (`@@ -a,b +c,d @@`) from the `gh pr diff` output.
|
|
177
|
+
- `side: RIGHT` for additions/context; `side: LEFT` only when the finding is explicitly about removed code.
|
|
178
|
+
- **Renamed files:** a `gh api .../files` entry carries the pre-rename path in a sibling `previous_filename` field (not in `patch`). When a finding references the pre-rename path, remap it to the entry's post-rename `filename` before classifying, or it will be treated as out-of-diff.
|
|
179
|
+
- If `line` falls outside the diff: downgrade the finding to a top-level "Findings outside the PR diff" subsection with its `file:line` reference. NEVER silently drop it and NEVER shift the line to the nearest in-diff line.
|
|
180
|
+
|
|
181
|
+
> **Reference implementation:** the canonical, tested logic for this step lives in `packages/cli/src/review-remote/line-mapper.ts` (`parsePullFilesPatch` / `parseUnifiedDiff` / `classifyFinding`). The bash/`jq` flow here mirrors it — keep the two in sync. See `packages/cli/src/review-remote/README.md`; `bl-a7cd` tracks wiring this skill to call the helpers directly. The same applies to the marker block (`marker-parser.ts`), body/verdict (`body-builder.ts`), and re-review narrowing (`narrowing.ts`) used in the steps below.
|
|
182
|
+
|
|
183
|
+
### Step 6: Build the Review Body + Verdict
|
|
184
|
+
|
|
185
|
+
Build the posted-review body (design.md → Data Models → Posted-review-body): a leading HTML-comment marker block, then summary, severity counts, the minor-fix "Notes" nudge (only when minor findings are present), and optional verification commands.
|
|
186
|
+
|
|
187
|
+
Markers (ad-hoc rail):
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
<!-- oat-review-metadata
|
|
191
|
+
oat_provide_remote: true
|
|
192
|
+
oat_review_head_sha: <PR_HEAD_SHA>
|
|
193
|
+
oat_review_scope: ad-hoc
|
|
194
|
+
oat_review_invocation: manual
|
|
195
|
+
-->
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
`oat_project` is omitted entirely on the ad-hoc rail. Verdict: `REQUEST_CHANGES` when any critical or important finding exists; `COMMENT` otherwise (including a clean, zero-findings review — never auto-`APPROVE`).
|
|
199
|
+
|
|
200
|
+
### Step 7: Post the Review + Clean Up
|
|
201
|
+
|
|
202
|
+
Probe `agent-reviews` for a posting flow with a non-mutating check (`npx agent-reviews --help`), cached for the run:
|
|
203
|
+
|
|
204
|
+
- If a posting flow is supported -> prefer `agent-reviews` for tooling symmetry.
|
|
205
|
+
- Otherwise (or if the probe is inconclusive) -> post via `gh api`. As of the current `agent-reviews` release there is no review-posting flow, so `gh api` is the expected path.
|
|
206
|
+
|
|
207
|
+
Present the body + verdict + inline-comment count to the user and get explicit confirmation, then post a single review.
|
|
208
|
+
|
|
209
|
+
`gh api --field`/`-f`/`-F` only set top-level scalar values; they CANNOT build the nested `comments[]` array of objects the reviews endpoint requires for inline comments. Construct the complete review payload as JSON and pipe it through `--input -` instead (a heredoc or a temp JSON file both work). Each in-diff finding (from Step 5) becomes one `comments[]` entry `{ path, line, side, body }`; out-of-diff findings are NOT added here — they were already downgraded into `$REVIEW_BODY` in Step 5. `event` is the Step 6 verdict (`REQUEST_CHANGES` when any critical/important finding exists, else `COMMENT`). A body-only review (zero in-diff findings) uses an empty `comments` array or omits the key:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# Build the payload as JSON. `comments` is the in-diff findings array; jq
|
|
213
|
+
# assembles it safely (escaping body text, numbers as numbers). For a
|
|
214
|
+
# body-only review, COMMENTS_JSON is `[]`.
|
|
215
|
+
jq -n \
|
|
216
|
+
--arg event "$VERDICT" \
|
|
217
|
+
--arg body "$REVIEW_BODY" \
|
|
218
|
+
--argjson comments "$COMMENTS_JSON" \
|
|
219
|
+
'{event: $event, body: $body, comments: $comments}' \
|
|
220
|
+
| gh api --method POST "/repos/{owner}/{repo}/pulls/$PR/reviews" --input -
|
|
221
|
+
|
|
222
|
+
# COMMENTS_JSON is a JSON array, one object per in-diff finding, e.g.:
|
|
223
|
+
# [
|
|
224
|
+
# { "path": "src/foo.ts", "line": 42, "side": "RIGHT", "body": "..." },
|
|
225
|
+
# { "path": "src/bar.ts", "line": 17, "side": "LEFT", "body": "..." }
|
|
226
|
+
# ]
|
|
227
|
+
# `side` is RIGHT for additions/context, LEFT only for explicit removed-code
|
|
228
|
+
# findings (Step 5). Use `[]` when there are no in-diff findings.
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Posting failure handling (design.md → Error Handling → Posting failures): on auth failure, surface `gh auth status` and stop (findings kept in memory). On PR closed/merged, surface a clear message and present findings inline. On inline-comment rejection, re-map against the current file list and retry once; if still rejected, downgrade the offending finding(s) and retry. On rate limit, surface the window and stop. NEVER silently drop a finding.
|
|
232
|
+
|
|
233
|
+
Always release the ephemeral worktree in a `finally`, even when review or posting fails:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
git -C "$REPO_ROOT" worktree remove --force "$EPHEMERAL_PATH" || git -C "$REPO_ROOT" worktree prune
|
|
237
|
+
rm -rf "$EPHEMERAL_PATH"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Troubleshooting
|
|
241
|
+
|
|
242
|
+
- Auth failure: run `gh auth status`; re-authenticate, then retry.
|
|
243
|
+
- No PR detected: pass explicit `--pr <N>`.
|
|
244
|
+
- Checkout fails: the skill auto-falls back to diff-only mode with a degraded-context warning; pass `--no-checkout` to force it.
|
|
245
|
+
- Prior-review SHA unreachable: re-invoke without `--narrow` to review full scope.
|
|
246
|
+
- Inline comment rejected at a file:line: the finding is downgraded to the top-level body, not dropped.
|
|
247
|
+
- Network / rate-limit errors: retry after backoff; report blocked state if persistent.
|
|
248
|
+
|
|
249
|
+
## Output Contract
|
|
250
|
+
|
|
251
|
+
At completion, report:
|
|
252
|
+
|
|
253
|
+
- PR number and HEAD SHA reviewed.
|
|
254
|
+
- Read mode (worktree checkout vs diff-only).
|
|
255
|
+
- Narrowing decision (full scope vs `<prior_sha>..<HEAD>`, and why).
|
|
256
|
+
- Severity counts and total findings.
|
|
257
|
+
- Inline-comment count posted vs findings downgraded to the body (out-of-diff).
|
|
258
|
+
- Verdict (`REQUEST_CHANGES` or `COMMENT`).
|
|
259
|
+
- Posting mechanism (`agent-reviews` or `gh api`) and whether the review was posted.
|
|
260
|
+
- Confirmation that the ephemeral worktree was removed.
|
|
261
|
+
|
|
262
|
+
## Success Criteria
|
|
263
|
+
|
|
264
|
+
- PR scope resolved and confirmed.
|
|
265
|
+
- PR content acquired via ephemeral worktree (or diff-only fallback) without mutating the caller's working tree.
|
|
266
|
+
- Prior provide-remote reviews detected; re-review narrowing applied only after the stale-SHA guard passes.
|
|
267
|
+
- Findings produced with consistent 4-tier severities and file:line references.
|
|
268
|
+
- Inline comments mapped to in-diff positions; out-of-diff findings downgraded to the body, never dropped.
|
|
269
|
+
- Posted-review body carries the marker block first, correct severity counts, and the minor-fix nudge when minors are present.
|
|
270
|
+
- Verdict matches the C/I rule (`REQUEST_CHANGES` vs `COMMENT`; never auto-`APPROVE`).
|
|
271
|
+
- Single PR review posted (with user confirmation) via `agent-reviews` if supported, else `gh api`.
|
|
272
|
+
- Ephemeral worktree removed on success and on failure.
|
|
273
|
+
- No local artifact, no lifecycle bookkeeping, no fixes/commits/pushes on this machine.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-review-receive
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.4.0
|
|
4
4
|
description: Use when processing review findings outside project context. Converts local review artifacts into actionable task lists.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -41,8 +41,8 @@ If you catch yourself:
|
|
|
41
41
|
|
|
42
42
|
- Editing project lifecycle docs in ad-hoc mode -> STOP and revert to task-list output only.
|
|
43
43
|
- Triaging without presenting a findings overview first -> STOP and show overview before disposition prompts.
|
|
44
|
-
- Skipping
|
|
45
|
-
-
|
|
44
|
+
- Skipping rationale when proposing deferral at any severity (including Minor) -> STOP and collect explicit rationale.
|
|
45
|
+
- Defaulting a Minor finding to `defer` instead of `convert` -> STOP; the Minor default is `convert` (fix inline), and `defer` requires concrete rationale.
|
|
46
46
|
|
|
47
47
|
**Recovery:**
|
|
48
48
|
|
|
@@ -182,12 +182,12 @@ Default suggestions:
|
|
|
182
182
|
- Critical -> `convert`
|
|
183
183
|
- Important -> `convert`
|
|
184
184
|
- Medium -> `convert` (propose `defer` only with concrete rationale)
|
|
185
|
-
- Minor -> `convert`
|
|
185
|
+
- Minor -> `convert` (propose `defer` only with concrete rationale)
|
|
186
186
|
|
|
187
187
|
Rules:
|
|
188
188
|
|
|
189
|
-
- Require explicit rationale for `defer` or `dismiss
|
|
190
|
-
- Do not recommend `defer` for a Minor finding solely because it does not impact current functionality
|
|
189
|
+
- Require explicit rationale for `defer` or `dismiss` at any severity, including Minor. Small findings are cheap to fix inline, so deferring a Minor into a backlog item must be justified just like any other deferral.
|
|
190
|
+
- Do not recommend `defer` for a Minor finding solely because it does not impact current functionality — fixing inline is usually cheaper than tracking it. Reserve `defer` for the genuine cases (low-probability cleanup, blocked dependency, duplicated elsewhere, explicitly out of scope, or disproportionate churn now).
|
|
191
191
|
- Do not silently skip findings.
|
|
192
192
|
|
|
193
193
|
### Step 5: Generate Task List Output
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-review-receive-remote
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.3.0
|
|
4
4
|
description: Use when processing GitHub PR review comments outside project context. Fetches PR comments via agent-reviews and converts them into actionable task lists.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -145,14 +145,14 @@ Before triage prompts, output:
|
|
|
145
145
|
|
|
146
146
|
Disposition options per finding:
|
|
147
147
|
|
|
148
|
-
- `convert` (default for critical/important/medium)
|
|
149
|
-
- `defer`
|
|
148
|
+
- `convert` (default for critical/important/medium/minor)
|
|
149
|
+
- `defer`
|
|
150
150
|
- `dismiss`
|
|
151
151
|
|
|
152
152
|
Rules:
|
|
153
153
|
|
|
154
|
-
- Require rationale for `defer`/`dismiss
|
|
155
|
-
- For
|
|
154
|
+
- Require concrete rationale for `defer`/`dismiss` at any severity, including minor. Small findings are usually cheaper to fix inline than to track as backlog items, so a minor `defer` must be justified just like any other deferral.
|
|
155
|
+
- For any deferral (minor included), require a concrete reason (duplicate, dependency, explicit out-of-scope follow-up, risky churn).
|
|
156
156
|
|
|
157
157
|
### Step 5: Generate Standalone Task List
|
|
158
158
|
|
|
@@ -11,7 +11,7 @@ export interface PackMetadata {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const PACK_METADATA: Record<string, PackMetadata>;
|
|
13
13
|
export declare function resolvePackDefaultScope(packName: string): 'user' | 'project';
|
|
14
|
-
export declare const WORKFLOW_SKILLS: readonly ["oat-project-capture", "oat-project-clear-active", "oat-project-complete", "oat-project-design", "oat-project-discover", "oat-project-document", "oat-project-implement", "oat-project-import-plan", "oat-project-new", "oat-project-next", "oat-project-open", "oat-project-plan", "oat-project-plan-writing", "oat-project-pr-final", "oat-project-pr-progress", "oat-project-progress", "oat-project-promote-spec-driven", "oat-project-quick-start", "oat-project-reconcile", "oat-project-revise", "oat-project-review-provide", "oat-project-review-receive", "oat-project-review-receive-remote", "oat-project-spec", "oat-project-split", "oat-project-summary", "oat-repo-knowledge-index", "oat-worktree-bootstrap", "oat-worktree-bootstrap-auto", "oat-wrap-up"];
|
|
14
|
+
export declare const WORKFLOW_SKILLS: readonly ["oat-project-capture", "oat-project-clear-active", "oat-project-complete", "oat-project-design", "oat-project-discover", "oat-project-document", "oat-project-implement", "oat-project-import-plan", "oat-project-new", "oat-project-next", "oat-project-open", "oat-project-plan", "oat-project-plan-writing", "oat-project-pr-final", "oat-project-pr-progress", "oat-project-progress", "oat-project-promote-spec-driven", "oat-project-quick-start", "oat-project-reconcile", "oat-project-revise", "oat-project-review-provide", "oat-project-review-provide-remote", "oat-project-review-receive", "oat-project-review-receive-remote", "oat-project-spec", "oat-project-split", "oat-project-summary", "oat-repo-knowledge-index", "oat-worktree-bootstrap", "oat-worktree-bootstrap-auto", "oat-wrap-up"];
|
|
15
15
|
export declare const WORKFLOW_AGENTS: readonly ["oat-codebase-mapper.md", "oat-phase-implementer.md", "oat-reviewer.md"];
|
|
16
16
|
export declare const WORKFLOW_TEMPLATES: readonly ["state.md", "discovery.md", "spec.md", "design.md", "plan.md", "implementation.md", "summary.md"];
|
|
17
17
|
export declare const WORKFLOW_SCRIPTS: readonly ["generate-oat-state.sh", "generate-thin-index.sh", "resolve-tracking.sh"];
|
|
@@ -19,7 +19,7 @@ export declare const IDEA_SKILLS: readonly ["oat-idea-new", "oat-idea-ideate", "
|
|
|
19
19
|
export declare const CORE_SKILLS: readonly ["oat-docs", "oat-doctor"];
|
|
20
20
|
export declare const DOCS_SKILLS: readonly ["oat-agent-instructions-analyze", "oat-agent-instructions-apply", "oat-docs-analyze", "oat-docs-apply", "oat-docs-bootstrap"];
|
|
21
21
|
export declare const DOCS_SCRIPTS: readonly ["resolve-tracking.sh"];
|
|
22
|
-
export declare const UTILITY_SKILLS: readonly ["create-agnostic-skill", "oat-repo-maintainability-review", "oat-review-provide", "oat-review-receive", "oat-review-receive-remote"];
|
|
22
|
+
export declare const UTILITY_SKILLS: readonly ["create-agnostic-skill", "oat-repo-maintainability-review", "oat-review-provide", "oat-review-provide-remote", "oat-review-receive", "oat-review-receive-remote"];
|
|
23
23
|
export declare const PROJECT_MANAGEMENT_SKILLS: readonly ["oat-pjm-add-backlog-item", "oat-pjm-update-repo-reference", "oat-pjm-review-backlog"];
|
|
24
24
|
export declare const PROJECT_MANAGEMENT_TEMPLATES: readonly ["backlog-item.md", "roadmap.md"];
|
|
25
25
|
export declare const PROJECT_MANAGEMENT_SCRIPTS: readonly [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAKtD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5E;AAID,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAKtD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5E;AAID,eAAO,MAAM,eAAe,6xBAgClB,CAAC;AAEX,eAAO,MAAM,eAAe,oFAIlB,CAAC;AAEX,eAAO,MAAM,kBAAkB,6GAQrB,CAAC;AAEX,eAAO,MAAM,gBAAgB,qFAInB,CAAC;AAIX,eAAO,MAAM,WAAW,2FAKd,CAAC;AAIX,eAAO,MAAM,WAAW,qCAAsC,CAAC;AAI/D,eAAO,MAAM,WAAW,yIAMd,CAAC;AAEX,eAAO,MAAM,YAAY,kCAAmC,CAAC;AAI7D,eAAO,MAAM,cAAc,6KAOjB,CAAC;AAIX,eAAO,MAAM,yBAAyB,kGAI5B,CAAC;AAEX,eAAO,MAAM,4BAA4B,4CAG/B,CAAC;AAEX,eAAO,MAAM,0BAA0B,aAAc,CAAC;AAItD,eAAO,MAAM,iBAAiB,6BAA8B,CAAC;AAI7D,eAAO,MAAM,eAAe,2EAMlB,CAAC;AAEX,eAAO,MAAM,eAAe,qCAAsC,CAAC"}
|
|
@@ -37,6 +37,7 @@ export const WORKFLOW_SKILLS = [
|
|
|
37
37
|
'oat-project-reconcile',
|
|
38
38
|
'oat-project-revise',
|
|
39
39
|
'oat-project-review-provide',
|
|
40
|
+
'oat-project-review-provide-remote',
|
|
40
41
|
'oat-project-review-receive',
|
|
41
42
|
'oat-project-review-receive-remote',
|
|
42
43
|
'oat-project-spec',
|
|
@@ -89,6 +90,7 @@ export const UTILITY_SKILLS = [
|
|
|
89
90
|
'create-agnostic-skill',
|
|
90
91
|
'oat-repo-maintainability-review',
|
|
91
92
|
'oat-review-provide',
|
|
93
|
+
'oat-review-provide-remote',
|
|
92
94
|
'oat-review-receive',
|
|
93
95
|
'oat-review-receive-remote',
|
|
94
96
|
];
|
|
@@ -10,6 +10,7 @@ interface ProjectNewDependencies {
|
|
|
10
10
|
force: boolean;
|
|
11
11
|
setActive: boolean;
|
|
12
12
|
refreshDashboard: boolean;
|
|
13
|
+
commit: boolean;
|
|
13
14
|
}) => Promise<ScaffoldProjectResult>;
|
|
14
15
|
}
|
|
15
16
|
export declare function createProjectNewCommand(overrides?: Partial<ProjectNewDependencies>): Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/new/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAE5C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC3B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/new/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAE5C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC3B,MAAM,YAAY,CAAC;AAgBpB,UAAU,sBAAsB;IAC9B,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,eAAe,EAAE,CAAC,OAAO,EAAE;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,mBAAmB,CAAC;QAC1B,KAAK,EAAE,OAAO,CAAC;QACf,SAAS,EAAE,OAAO,CAAC;QACnB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,MAAM,EAAE,OAAO,CAAC;KACjB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACtC;AAoFD,wBAAgB,uBAAuB,CACrC,SAAS,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC9C,OAAO,CAkCT"}
|
|
@@ -2,6 +2,11 @@ import { buildCommandContext, } from '../../../app/command-context.js';
|
|
|
2
2
|
import { readGlobalOptions } from '../../shared/shared.utils.js';
|
|
3
3
|
import { Command, Option } from 'commander';
|
|
4
4
|
import { scaffoldProject as defaultScaffoldProject, } from './scaffold.js';
|
|
5
|
+
const COMMIT_STATUS_MESSAGES = {
|
|
6
|
+
skipped_disabled: 'Scaffold commit: skipped (--no-commit)',
|
|
7
|
+
skipped_no_worktree: 'Scaffold commit: skipped (not a git work tree)',
|
|
8
|
+
skipped_nothing: 'Scaffold commit: skipped (nothing to commit)',
|
|
9
|
+
};
|
|
5
10
|
const DEFAULT_DEPENDENCIES = {
|
|
6
11
|
buildCommandContext,
|
|
7
12
|
scaffoldProject: defaultScaffoldProject,
|
|
@@ -18,6 +23,10 @@ function reportSuccess(context, projectName, result) {
|
|
|
18
23
|
skippedFiles: result.skippedFiles,
|
|
19
24
|
activePointerUpdated: result.activePointerUpdated,
|
|
20
25
|
dashboardRefreshed: result.dashboardRefreshed,
|
|
26
|
+
committed: result.committed,
|
|
27
|
+
commitSha: result.commitSha,
|
|
28
|
+
commitStatus: result.commitStatus,
|
|
29
|
+
commitError: result.commitError,
|
|
21
30
|
});
|
|
22
31
|
return;
|
|
23
32
|
}
|
|
@@ -26,6 +35,18 @@ function reportSuccess(context, projectName, result) {
|
|
|
26
35
|
if (result.activePointerUpdated) {
|
|
27
36
|
context.logger.info('Active project updated in local config: .oat/config.local.json');
|
|
28
37
|
}
|
|
38
|
+
if (result.commitStatus === 'committed') {
|
|
39
|
+
context.logger.info(`Scaffold commit: ${result.commitSha?.slice(0, 7) ?? 'committed'}`);
|
|
40
|
+
}
|
|
41
|
+
else if (result.commitStatus === 'failed') {
|
|
42
|
+
// The scaffold itself succeeded, so this is a warning, not an error: do not
|
|
43
|
+
// change the process exit code. Make clear the baseline was NOT committed.
|
|
44
|
+
const detail = result.commitError ? `: ${result.commitError}` : '';
|
|
45
|
+
context.logger.warn(`Warning: scaffold commit failed${detail}. The scaffolded files were written but NOT committed.`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
context.logger.info(COMMIT_STATUS_MESSAGES[result.commitStatus]);
|
|
49
|
+
}
|
|
29
50
|
}
|
|
30
51
|
async function runProjectNew(projectName, options, context, dependencies) {
|
|
31
52
|
try {
|
|
@@ -36,6 +57,7 @@ async function runProjectNew(projectName, options, context, dependencies) {
|
|
|
36
57
|
force: options.force,
|
|
37
58
|
setActive: options.setActive,
|
|
38
59
|
refreshDashboard: options.dashboard,
|
|
60
|
+
commit: options.commit,
|
|
39
61
|
});
|
|
40
62
|
reportSuccess(context, projectName, result);
|
|
41
63
|
process.exitCode = 0;
|
|
@@ -65,6 +87,7 @@ export function createProjectNewCommand(overrides = {}) {
|
|
|
65
87
|
.option('--force', 'Non-destructive scaffold; create missing files only')
|
|
66
88
|
.option('--no-set-active', 'Do not update active project in local config')
|
|
67
89
|
.option('--no-dashboard', 'Do not refresh .oat/state.md after scaffold')
|
|
90
|
+
.option('--no-commit', 'Do not git-commit the scaffolded project directory')
|
|
68
91
|
.action(async (name, options, command) => {
|
|
69
92
|
if (name.startsWith('-')) {
|
|
70
93
|
command.help();
|
|
@@ -6,11 +6,24 @@ export interface ScaffoldProjectOptions {
|
|
|
6
6
|
force?: boolean;
|
|
7
7
|
setActive?: boolean;
|
|
8
8
|
refreshDashboard?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Commit the freshly scaffolded project directory so the artifact baseline is
|
|
11
|
+
* git-tracked from t=0. Opt-in (default false) so library callers that manage
|
|
12
|
+
* their own commits (e.g. the project-split flow) are unaffected; only the
|
|
13
|
+
* `oat project new` command enables it by default.
|
|
14
|
+
*/
|
|
15
|
+
commit?: boolean;
|
|
9
16
|
env?: NodeJS.ProcessEnv;
|
|
10
17
|
today?: string;
|
|
11
18
|
nowUtc?: string;
|
|
12
19
|
refreshDashboardCallback?: (repoRoot: string) => void | Promise<void>;
|
|
13
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Classified outcome of the scoped scaffold commit. Distinguishing the skip
|
|
23
|
+
* reasons (and `failed`) lets the CLI surface accurate, distinct messaging
|
|
24
|
+
* instead of collapsing every non-commit into a single benign "skipped" line.
|
|
25
|
+
*/
|
|
26
|
+
export type CommitScaffoldStatus = 'committed' | 'skipped_disabled' | 'skipped_no_worktree' | 'skipped_nothing' | 'failed';
|
|
14
27
|
export interface ScaffoldProjectResult {
|
|
15
28
|
mode: ProjectScaffoldMode;
|
|
16
29
|
projectsRoot: string;
|
|
@@ -19,6 +32,10 @@ export interface ScaffoldProjectResult {
|
|
|
19
32
|
skippedFiles: string[];
|
|
20
33
|
activePointerUpdated: boolean;
|
|
21
34
|
dashboardRefreshed: boolean;
|
|
35
|
+
committed: boolean;
|
|
36
|
+
commitSha?: string;
|
|
37
|
+
commitStatus: CommitScaffoldStatus;
|
|
38
|
+
commitError?: string;
|
|
22
39
|
}
|
|
23
40
|
export declare function scaffoldProject(options: ScaffoldProjectOptions): Promise<ScaffoldProjectResult>;
|
|
24
41
|
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/new/scaffold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/new/scaffold.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B,WAAW,GACX,kBAAkB,GAClB,qBAAqB,GACrB,iBAAiB,GACjB,QAAQ,CAAC;AAEb,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,oBAAoB,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoRD,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CA4EhC"}
|