@mestreyoda/fabrica 0.2.28 → 0.2.30
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/dist/index.js +74 -2
- package/genesis/scripts/scaffold-project.sh +40 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113905,8 +113905,8 @@ import fsSync from "node:fs";
|
|
|
113905
113905
|
import path5 from "node:path";
|
|
113906
113906
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
113907
113907
|
function getCurrentVersion() {
|
|
113908
|
-
if ("0.2.
|
|
113909
|
-
return "0.2.
|
|
113908
|
+
if ("0.2.30") {
|
|
113909
|
+
return "0.2.30";
|
|
113910
113910
|
}
|
|
113911
113911
|
try {
|
|
113912
113912
|
const pkgPath = path5.join(THIS_DIR, "..", "..", "package.json");
|
|
@@ -142992,6 +142992,78 @@ async function handleTelegramBootstrapDmMessage(ctx, rawConversationId, content)
|
|
|
142992
142992
|
));
|
|
142993
142993
|
return;
|
|
142994
142994
|
}
|
|
142995
|
+
if (existingSession?.status === "completed" && !sessionIsExpired && existingSession.triageReadyForDispatch === false && existingSession.issueId && existingSession.projectSlug && existingSession.triageErrors?.includes("dor_auth_requirements_missing") && content.trim().length >= 12) {
|
|
142996
|
+
const projects = await readProjects(workspaceDir).catch(() => null);
|
|
142997
|
+
const project = existingSession.projectSlug ? projects?.projects?.[existingSession.projectSlug] : null;
|
|
142998
|
+
if (project?.repo) {
|
|
142999
|
+
const { provider } = await createProvider({
|
|
143000
|
+
repo: project.repo,
|
|
143001
|
+
provider: project.provider,
|
|
143002
|
+
runCommand: ctx.runCommand,
|
|
143003
|
+
pluginConfig: ctx.pluginConfig,
|
|
143004
|
+
providerProfile: project.providerProfile
|
|
143005
|
+
});
|
|
143006
|
+
const issue2 = await provider.getIssue(existingSession.issueId).catch(() => null);
|
|
143007
|
+
const clarificationBlock = [
|
|
143008
|
+
"## Human Clarification",
|
|
143009
|
+
"",
|
|
143010
|
+
content.trim()
|
|
143011
|
+
].join("\n");
|
|
143012
|
+
const currentBody = issue2?.description ?? "";
|
|
143013
|
+
const nextBody = currentBody.includes("## Human Clarification") ? `${currentBody.trim()}
|
|
143014
|
+
|
|
143015
|
+
${content.trim()}` : `${currentBody.trim()}
|
|
143016
|
+
|
|
143017
|
+
${clarificationBlock}`.trim();
|
|
143018
|
+
await provider.editIssue(existingSession.issueId, { body: nextBody }).catch(() => {
|
|
143019
|
+
});
|
|
143020
|
+
await provider.addComment(existingSession.issueId, [
|
|
143021
|
+
"\u2705 Telegram clarification received; resuming automatic dispatch.",
|
|
143022
|
+
"",
|
|
143023
|
+
content.trim()
|
|
143024
|
+
].join("\n")).catch(() => {
|
|
143025
|
+
});
|
|
143026
|
+
await provider.removeLabels(existingSession.issueId, ["needs-human"]).catch(() => {
|
|
143027
|
+
});
|
|
143028
|
+
await provider.transitionLabel(existingSession.issueId, "Planning", "To Do").catch(() => {
|
|
143029
|
+
});
|
|
143030
|
+
await provider.addLabel(existingSession.issueId, "developer:medior").catch(() => {
|
|
143031
|
+
});
|
|
143032
|
+
const resumedSession = await upsertTelegramBootstrapSession(workspaceDir, {
|
|
143033
|
+
conversationId,
|
|
143034
|
+
rawIdea: `${existingSession.rawIdea}
|
|
143035
|
+
|
|
143036
|
+
Clarification:
|
|
143037
|
+
${content.trim()}`,
|
|
143038
|
+
projectName: existingSession.projectName ?? void 0,
|
|
143039
|
+
stackHint: existingSession.stackHint ?? void 0,
|
|
143040
|
+
repoUrl: existingSession.repoUrl ?? void 0,
|
|
143041
|
+
repoPath: existingSession.repoPath ?? void 0,
|
|
143042
|
+
sourceRoute: existingSession.sourceRoute,
|
|
143043
|
+
projectRoute: existingSession.projectRoute,
|
|
143044
|
+
projectSlug: existingSession.projectSlug,
|
|
143045
|
+
issueId: existingSession.issueId,
|
|
143046
|
+
issueUrl: existingSession.issueUrl,
|
|
143047
|
+
triageReadyForDispatch: true,
|
|
143048
|
+
triageErrors: [],
|
|
143049
|
+
projectChannelId: existingSession.projectChannelId,
|
|
143050
|
+
messageThreadId: existingSession.messageThreadId,
|
|
143051
|
+
language: existingSession.language,
|
|
143052
|
+
status: "dispatching",
|
|
143053
|
+
bootstrapStep: existingSession.bootstrapStep ?? "project_registered",
|
|
143054
|
+
projectRegisteredAt: existingSession.projectRegisteredAt,
|
|
143055
|
+
topicKickoffSentAt: existingSession.topicKickoffSentAt,
|
|
143056
|
+
projectTickedAt: existingSession.projectTickedAt,
|
|
143057
|
+
completionAckSentAt: existingSession.completionAckSentAt,
|
|
143058
|
+
ackSentAt: existingSession.ackSentAt,
|
|
143059
|
+
error: null
|
|
143060
|
+
});
|
|
143061
|
+
if (resumedSession) {
|
|
143062
|
+
await completeRegisteredBootstrap(ctx, workspaceDir, resumedSession);
|
|
143063
|
+
}
|
|
143064
|
+
return;
|
|
143065
|
+
}
|
|
143066
|
+
}
|
|
142995
143067
|
if (!isBootstrapCandidate(content)) {
|
|
142996
143068
|
if (isAmbiguousCandidate(content)) {
|
|
142997
143069
|
const classifyOwner = resolveBootstrapAttemptOwner(existingSession);
|
|
@@ -1072,14 +1072,22 @@ else
|
|
|
1072
1072
|
echo "[qa] WARNING: No QA toolchain found at $TOOLCHAIN" >&2
|
|
1073
1073
|
fi
|
|
1074
1074
|
|
|
1075
|
+
ROOT="$(pwd)"
|
|
1076
|
+
sanitize_public_output() {
|
|
1077
|
+
sed -E \
|
|
1078
|
+
-e "s#${ROOT}#.#g" \
|
|
1079
|
+
-e 's#file://[^[:space:]]+#file://.#g' \
|
|
1080
|
+
-e 's#/home/[^[:space:]]+/git/[^[:space:]]+#.#g'
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1075
1083
|
echo "=== QA Gate ==="
|
|
1076
1084
|
FAIL=0
|
|
1077
1085
|
|
|
1078
1086
|
echo "--- Ruff lint ---"
|
|
1079
|
-
ruff check app/ tests/ 2>&1 || { echo "RUFF FAILED"; FAIL=1; }
|
|
1087
|
+
ruff check app/ tests/ 2>&1 | sanitize_public_output || { echo "RUFF FAILED"; FAIL=1; }
|
|
1080
1088
|
|
|
1081
1089
|
echo "--- Mypy ---"
|
|
1082
|
-
mypy app/ 2>&1 || { echo "MYPY FAILED"; FAIL=1; }
|
|
1090
|
+
mypy app/ 2>&1 | sanitize_public_output || { echo "MYPY FAILED"; FAIL=1; }
|
|
1083
1091
|
|
|
1084
1092
|
echo "--- Tests ---"
|
|
1085
1093
|
python -m pytest tests/ -v 2>&1 | sanitize_public_output || { echo "TESTS FAILED"; FAIL=1; }
|
|
@@ -1203,14 +1211,22 @@ else
|
|
|
1203
1211
|
echo "[qa] WARNING: No QA toolchain found at $TOOLCHAIN" >&2
|
|
1204
1212
|
fi
|
|
1205
1213
|
|
|
1214
|
+
ROOT="$(pwd)"
|
|
1215
|
+
sanitize_public_output() {
|
|
1216
|
+
sed -E \
|
|
1217
|
+
-e "s#${ROOT}#.#g" \
|
|
1218
|
+
-e 's#file://[^[:space:]]+#file://.#g' \
|
|
1219
|
+
-e 's#/home/[^[:space:]]+/git/[^[:space:]]+#.#g'
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1206
1222
|
echo "=== QA Gate ==="
|
|
1207
1223
|
FAIL=0
|
|
1208
1224
|
|
|
1209
1225
|
echo "--- Ruff lint ---"
|
|
1210
|
-
ruff check app/ tests/ 2>&1 || { echo "RUFF FAILED"; FAIL=1; }
|
|
1226
|
+
ruff check app/ tests/ 2>&1 | sanitize_public_output || { echo "RUFF FAILED"; FAIL=1; }
|
|
1211
1227
|
|
|
1212
1228
|
echo "--- Mypy ---"
|
|
1213
|
-
mypy app/ 2>&1 || { echo "MYPY FAILED"; FAIL=1; }
|
|
1229
|
+
mypy app/ 2>&1 | sanitize_public_output || { echo "MYPY FAILED"; FAIL=1; }
|
|
1214
1230
|
|
|
1215
1231
|
echo "--- Tests ---"
|
|
1216
1232
|
python -m pytest tests/ -v 2>&1 | sanitize_public_output || { echo "TESTS FAILED"; FAIL=1; }
|
|
@@ -1398,14 +1414,22 @@ else
|
|
|
1398
1414
|
echo "[qa] WARNING: No QA toolchain found at $TOOLCHAIN" >&2
|
|
1399
1415
|
fi
|
|
1400
1416
|
|
|
1417
|
+
ROOT="$(pwd)"
|
|
1418
|
+
sanitize_public_output() {
|
|
1419
|
+
sed -E \
|
|
1420
|
+
-e "s#${ROOT}#.#g" \
|
|
1421
|
+
-e 's#file://[^[:space:]]+#file://.#g' \
|
|
1422
|
+
-e 's#/home/[^[:space:]]+/git/[^[:space:]]+#.#g'
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1401
1425
|
echo "=== QA Gate ==="
|
|
1402
1426
|
FAIL=0
|
|
1403
1427
|
|
|
1404
1428
|
echo "--- Ruff lint ---"
|
|
1405
|
-
ruff check app/ tests/ 2>&1 || { echo "RUFF FAILED"; FAIL=1; }
|
|
1429
|
+
ruff check app/ tests/ 2>&1 | sanitize_public_output || { echo "RUFF FAILED"; FAIL=1; }
|
|
1406
1430
|
|
|
1407
1431
|
echo "--- Mypy ---"
|
|
1408
|
-
mypy app/ 2>&1 || { echo "MYPY FAILED"; FAIL=1; }
|
|
1432
|
+
mypy app/ 2>&1 | sanitize_public_output || { echo "MYPY FAILED"; FAIL=1; }
|
|
1409
1433
|
|
|
1410
1434
|
echo "--- Tests ---"
|
|
1411
1435
|
python -m pytest tests/ -v 2>&1 | sanitize_public_output || { echo "TESTS FAILED"; FAIL=1; }
|
|
@@ -1537,14 +1561,22 @@ else
|
|
|
1537
1561
|
echo "[qa] WARNING: No QA toolchain found at $TOOLCHAIN" >&2
|
|
1538
1562
|
fi
|
|
1539
1563
|
|
|
1564
|
+
ROOT="$(pwd)"
|
|
1565
|
+
sanitize_public_output() {
|
|
1566
|
+
sed -E \
|
|
1567
|
+
-e "s#${ROOT}#.#g" \
|
|
1568
|
+
-e 's#file://[^[:space:]]+#file://.#g' \
|
|
1569
|
+
-e 's#/home/[^[:space:]]+/git/[^[:space:]]+#.#g'
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1540
1572
|
echo "=== QA Gate ==="
|
|
1541
1573
|
FAIL=0
|
|
1542
1574
|
|
|
1543
1575
|
echo "--- Ruff lint ---"
|
|
1544
|
-
ruff check src/ tests/ 2>&1 || { echo "RUFF FAILED"; FAIL=1; }
|
|
1576
|
+
ruff check src/ tests/ 2>&1 | sanitize_public_output || { echo "RUFF FAILED"; FAIL=1; }
|
|
1545
1577
|
|
|
1546
1578
|
echo "--- Mypy ---"
|
|
1547
|
-
mypy src/ 2>&1 || { echo "MYPY FAILED"; FAIL=1; }
|
|
1579
|
+
mypy src/ 2>&1 | sanitize_public_output || { echo "MYPY FAILED"; FAIL=1; }
|
|
1548
1580
|
|
|
1549
1581
|
echo "--- Tests ---"
|
|
1550
1582
|
python -m pytest tests/ -v 2>&1 | sanitize_public_output || { echo "TESTS FAILED"; FAIL=1; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mestreyoda/fabrica",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.30",
|
|
4
4
|
"description": "Autonomous software engineering pipeline for OpenClaw. Turns ideas into deployed code via intake, dispatch, review, test, and merge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|