@mestreyoda/fabrica 0.2.6 → 0.2.7

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.
@@ -73,8 +73,7 @@ Do **not** treat the task envelope (`Repo:`, `Project:`, `Channel:`, branch hint
73
73
 
74
74
  - Read the PR diff carefully
75
75
  - Check the code against the review checklist
76
- - Call `review_submit` with your review findings so the artifact is written to the PR itself
77
- - Then call `work_finish`
76
+ - Submit your review using **one of the two methods below** (prefer `review_submit` if available)
78
77
 
79
78
  ## Conventions
80
79
 
@@ -92,22 +91,50 @@ If you discover unrelated bugs or needed improvements, call `task_create`:
92
91
 
93
92
  ## Completing Your Task
94
93
 
95
- When you are done, submit the review artifact first, then **call `work_finish` yourself** do not just announce in text.
94
+ When you are done, submit your review using **Method A** if the tools are available, or **Method B** otherwise.
96
95
 
97
- - **Approve review artifact:** `review_submit({ channelId: "<project slug from 'Project:' field in task message>", issueId: <issue number>, result: "approve", body: "<what you checked>" })`
98
- - **Reject review artifact:** `review_submit({ channelId: "<project slug from 'Project:' field in task message>", issueId: <issue number>, result: "reject", body: "<specific issues>" })`
99
- - Capture the returned `artifactId` and `artifactType` from `review_submit`.
96
+ ### Method A Fabrica tools (preferred)
100
97
 
101
- **Never call `task_comment` for review findings.** The orchestrator may mirror your result to the issue separately, but your authoritative feedback must live on the PR via `review_submit`.
102
-
103
- - **Approve:** `work_finish({ role: "reviewer", result: "approve", channelId: "<project slug from 'Project:' field in task message>", summary: "<what you checked>", reviewArtifactId: <artifactId>, reviewArtifactType: "<artifactType>" })`
104
- - **Reject:** `work_finish({ role: "reviewer", result: "reject", channelId: "<project slug from 'Project:' field in task message>", summary: "<specific issues>", reviewArtifactId: <artifactId>, reviewArtifactType: "<artifactType>" })`
105
- - **Blocked:** `work_finish({ role: "reviewer", result: "blocked", channelId: "<project slug from 'Project:' field in task message>", summary: "<what you need>" })`
98
+ 1. Call `review_submit` to write the review artifact to the PR:
99
+ - **Approve:** `review_submit({ channelId: "<project slug>", issueId: <issue number>, result: "approve", body: "<what you checked>" })`
100
+ - **Reject:** `review_submit({ channelId: "<project slug>", issueId: <issue number>, result: "reject", body: "<specific issues>" })`
101
+ - Capture the returned `artifactId` and `artifactType`.
102
+ 2. Then call `work_finish`:
103
+ - **Approve:** `work_finish({ role: "reviewer", result: "approve", channelId: "<project slug>", summary: "<what you checked>", reviewArtifactId: <artifactId>, reviewArtifactType: "<artifactType>" })`
104
+ - **Reject:** `work_finish({ role: "reviewer", result: "reject", channelId: "<project slug>", summary: "<specific issues>", reviewArtifactId: <artifactId>, reviewArtifactType: "<artifactType>" })`
105
+ - **Blocked:** `work_finish({ role: "reviewer", result: "blocked", channelId: "<project slug>", summary: "<what you need>" })`
106
106
 
107
107
  > **IMPORTANT:** The `channelId` parameter accepts the project slug (e.g., "gestao-notas").
108
108
  > Extract it from the "Project: <name>" line in your task message. Do NOT use the numeric
109
109
  > channel ID — use the project slug to avoid resolution errors when channels are shared.
110
110
 
111
+ ### Method B — GitHub CLI fallback (use only if `review_submit` / `work_finish` are unavailable)
112
+
113
+ Extract from your task message:
114
+ - `OWNER/REPO` from the `Repo:` line
115
+ - `PR_NUMBER` from the PR URL in the diff header or the `Branch:` line
116
+ - `ISSUE_NUMBER` from the `Issue:` field
117
+
118
+ **Approve:**
119
+ ```bash
120
+ gh pr review PR_NUMBER --repo OWNER/REPO --approve -b "$(cat <<'EOF'
121
+ <your full review body here>
122
+ EOF
123
+ )"
124
+ ```
125
+
126
+ **Reject (request changes):**
127
+ ```bash
128
+ gh pr review PR_NUMBER --repo OWNER/REPO --request-changes -b "$(cat <<'EOF'
129
+ <specific issues and how to fix them>
130
+ EOF
131
+ )"
132
+ ```
133
+
134
+ After submitting via `gh pr review`, the Fabrica heartbeat will detect the PR review state and advance the pipeline automatically. **Do NOT manually edit issue labels.**
135
+
136
+ **Never call `task_comment` for review findings.** Your review must be posted on the PR itself.
137
+
111
138
  ## Tools You Should NOT Use
112
139
 
113
140
  These are orchestrator-only tools. Do not call them:
package/dist/index.js CHANGED
@@ -111330,8 +111330,8 @@ import fsSync from "node:fs";
111330
111330
  import path5 from "node:path";
111331
111331
  import { fileURLToPath as fileURLToPath3 } from "node:url";
111332
111332
  function getCurrentVersion() {
111333
- if ("0.2.6") {
111334
- return "0.2.6";
111333
+ if ("0.2.7") {
111334
+ return "0.2.7";
111335
111335
  }
111336
111336
  try {
111337
111337
  const pkgPath = path5.join(THIS_DIR, "..", "..", "package.json");
@@ -130791,7 +130791,7 @@ async function reviewPass(opts) {
130791
130791
  const issues = await provider.listIssuesByLabel(state.label);
130792
130792
  for (const issue2 of issues) {
130793
130793
  const routing = detectStepRouting(issue2.labels, "review");
130794
- if (routing !== "human") continue;
130794
+ if (routing !== "human" && routing !== "agent") continue;
130795
130795
  const isManaged = await provider.issueHasReaction(issue2.iid, "eyes");
130796
130796
  if (!isManaged) continue;
130797
130797
  const status = await provider.getPrStatus(issue2.iid);