@xn-intenton-z2a/agentic-lib 7.4.56 → 7.4.57
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/.github/workflows/agentic-lib-workflow.yml +14 -3
- package/package.json +1 -1
- package/src/actions/agentic-step/tasks/direct.js +7 -5
- package/src/actions/agentic-step/tasks/implementation-review.js +7 -43
- package/src/actions/agentic-step/tasks/report.js +13 -8
- package/src/seeds/zero-package.json +1 -1
|
@@ -1317,6 +1317,10 @@ jobs:
|
|
|
1317
1317
|
git config user.name 'GitHub Actions[bot]'
|
|
1318
1318
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
1319
1319
|
git add -A
|
|
1320
|
+
# Unstage log/screenshot/state files — these live on the agentic-lib-logs branch
|
|
1321
|
+
git reset HEAD -- 'intentïon.md' 'SCREENSHOT_INDEX.png' 2>/dev/null || true
|
|
1322
|
+
git reset HEAD -- agent-log-*.md 2>/dev/null || true
|
|
1323
|
+
git reset HEAD -- agentic-lib-state.toml 2>/dev/null || true
|
|
1320
1324
|
if ! git diff --cached --quiet; then
|
|
1321
1325
|
git commit -m "agentic-step: fix failing tests / resolve conflicts"
|
|
1322
1326
|
git push origin HEAD:"$BRANCH" 2>&1 || git push --force-with-lease origin HEAD:"$BRANCH" 2>&1
|
|
@@ -1393,6 +1397,10 @@ jobs:
|
|
|
1393
1397
|
git config --local user.email 'action@github.com'
|
|
1394
1398
|
git config --local user.name 'GitHub Actions[bot]'
|
|
1395
1399
|
git add -A
|
|
1400
|
+
# Unstage log/screenshot/state files — these live on the agentic-lib-logs branch
|
|
1401
|
+
git reset HEAD -- 'intentïon.md' 'SCREENSHOT_INDEX.png' 2>/dev/null || true
|
|
1402
|
+
git reset HEAD -- agent-log-*.md 2>/dev/null || true
|
|
1403
|
+
git reset HEAD -- agentic-lib-state.toml 2>/dev/null || true
|
|
1396
1404
|
git commit -m "agentic-step: fix broken main build (run ${{ env.FIX_RUN_ID }})"
|
|
1397
1405
|
git push -u origin agentic-lib-fix-main-build
|
|
1398
1406
|
gh pr create \
|
|
@@ -1746,15 +1754,18 @@ jobs:
|
|
|
1746
1754
|
try {
|
|
1747
1755
|
await github.rest.pulls.merge({
|
|
1748
1756
|
owner, repo, pull_number: prNumber, merge_method: 'squash',
|
|
1757
|
+
commit_message: closesLines + '\n\nAutomated transformation.',
|
|
1749
1758
|
});
|
|
1750
1759
|
core.info(`Merged PR #${prNumber}`);
|
|
1751
1760
|
try {
|
|
1752
1761
|
await github.rest.git.deleteRef({ owner, repo, ref: `heads/${branchName}` });
|
|
1753
1762
|
} catch (e) {}
|
|
1754
|
-
|
|
1763
|
+
// Close all referenced issues (belt-and-suspenders with Closes keywords)
|
|
1764
|
+
for (const num of issueNumbers) {
|
|
1755
1765
|
try {
|
|
1756
|
-
await github.rest.issues.
|
|
1757
|
-
await github.rest.issues.
|
|
1766
|
+
await github.rest.issues.update({ owner, repo, issue_number: parseInt(num), state: 'closed' });
|
|
1767
|
+
await github.rest.issues.addLabels({ owner, repo, issue_number: parseInt(num), labels: ['merged'] });
|
|
1768
|
+
await github.rest.issues.removeLabel({ owner, repo, issue_number: parseInt(num), name: 'in-progress' });
|
|
1758
1769
|
} catch (e) {}
|
|
1759
1770
|
}
|
|
1760
1771
|
return;
|
package/package.json
CHANGED
|
@@ -70,7 +70,6 @@ async function buildMetricAssessment(ctx, config) {
|
|
|
70
70
|
const minResolved = thresholds.minResolvedIssues ?? 1;
|
|
71
71
|
const maxTodos = thresholds.maxSourceTodos ?? 0;
|
|
72
72
|
const minCumulativeTransforms = thresholds.minCumulativeTransforms ?? 1;
|
|
73
|
-
const acceptanceThreshold = thresholds.acceptanceCriteriaThreshold ?? 50;
|
|
74
73
|
const requireNoOpenIssues = thresholds.requireNoOpenIssues ?? true;
|
|
75
74
|
const requireNoOpenPrs = thresholds.requireNoOpenPrs ?? true;
|
|
76
75
|
const requireNoCriticalGaps = thresholds.requireNoCriticalGaps ?? true;
|
|
@@ -83,14 +82,16 @@ async function buildMetricAssessment(ctx, config) {
|
|
|
83
82
|
} catch { /* ignore parse errors */ }
|
|
84
83
|
const criticalGaps = reviewGaps.filter((g) => g.severity === "critical");
|
|
85
84
|
|
|
86
|
-
// Acceptance criteria
|
|
85
|
+
// Acceptance criteria — informational only (not a mechanical gate).
|
|
86
|
+
// The director LLM reads criteria from MISSION.md and assesses them directly.
|
|
87
87
|
const { countAcceptanceCriteria } = await import("../../../copilot/telemetry.js");
|
|
88
88
|
const missionPath = config.paths?.mission?.path || "MISSION.md";
|
|
89
89
|
const acceptance = countAcceptanceCriteria(missionPath);
|
|
90
90
|
const acceptancePct = acceptance.total > 0 ? (acceptance.met / acceptance.total) * 100 : 0;
|
|
91
|
-
const acceptanceMet = acceptance.total > 0 && acceptancePct >= acceptanceThreshold;
|
|
92
91
|
|
|
93
|
-
//
|
|
92
|
+
// FIX-10: Require at least one test file that imports from src/lib/
|
|
93
|
+
const { dedicatedTestCount } = detectDedicatedTests();
|
|
94
|
+
|
|
94
95
|
const metrics = [
|
|
95
96
|
{ metric: "Open issues", value: ctx.issuesSummary.length, target: 0, met: requireNoOpenIssues ? ctx.issuesSummary.length === 0 : true },
|
|
96
97
|
{ metric: "Open PRs", value: ctx.prsSummary.length, target: 0, met: requireNoOpenPrs ? ctx.prsSummary.length === 0 : true },
|
|
@@ -99,7 +100,8 @@ async function buildMetricAssessment(ctx, config) {
|
|
|
99
100
|
{ metric: "Cumulative transforms", value: ctx.cumulativeTransformationCost, target: minCumulativeTransforms, met: ctx.cumulativeTransformationCost >= minCumulativeTransforms },
|
|
100
101
|
{ metric: "Budget", value: ctx.cumulativeTransformationCost, target: ctx.transformationBudget || "unlimited", met: !(ctx.transformationBudget > 0 && ctx.cumulativeTransformationCost >= ctx.transformationBudget) },
|
|
101
102
|
{ metric: "Implementation review", value: criticalGaps.length === 0 ? "No critical gaps" : `${criticalGaps.length} critical gap(s)`, target: "No critical gaps", met: requireNoCriticalGaps ? criticalGaps.length === 0 : true },
|
|
102
|
-
{ metric: "Acceptance criteria", value: acceptance.total > 0 ? `${acceptance.met}/${acceptance.total} (${Math.round(acceptancePct)}%)` : "N/A", target:
|
|
103
|
+
{ metric: "Acceptance criteria", value: acceptance.total > 0 ? `${acceptance.met}/${acceptance.total} (${Math.round(acceptancePct)}%)` : "N/A", target: "informational", met: true },
|
|
104
|
+
{ metric: "Dedicated test files", value: dedicatedTestCount, target: ">= 1", met: dedicatedTestCount >= 1 },
|
|
103
105
|
];
|
|
104
106
|
|
|
105
107
|
const allMet = metrics.every((m) => m.met);
|
|
@@ -215,49 +215,13 @@ export async function implementationReview(context) {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
// Index-based update: find the Nth checkbox and check it
|
|
227
|
-
if (metIndices.length > 0) {
|
|
228
|
-
const lines = missionContent.split("\n");
|
|
229
|
-
let checkboxIdx = 0;
|
|
230
|
-
for (let i = 0; i < lines.length; i++) {
|
|
231
|
-
if (/^- \[ \] /.test(lines[i])) {
|
|
232
|
-
checkboxIdx++;
|
|
233
|
-
if (metIndices.includes(checkboxIdx)) {
|
|
234
|
-
lines[i] = lines[i].replace(/^- \[ \] /, "- [x] ");
|
|
235
|
-
checkedCount++;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
missionContent = lines.join("\n");
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// Text-based update (fallback for backwards compatibility)
|
|
243
|
-
if (checkedCount === 0 && metCriteria.length > 0) {
|
|
244
|
-
for (const criterionText of metCriteria) {
|
|
245
|
-
const escaped = criterionText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").trim();
|
|
246
|
-
const re = new RegExp(`- \\[ \\] ${escaped}`);
|
|
247
|
-
if (re.test(missionContent)) {
|
|
248
|
-
missionContent = missionContent.replace(re, `- [x] ${criterionText.trim()}`);
|
|
249
|
-
checkedCount++;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (checkedCount > 0) {
|
|
255
|
-
writeFileSync(missionPath, missionContent, "utf8");
|
|
256
|
-
core.info(`Updated ${checkedCount} acceptance criteria checkboxes in ${missionPath}`);
|
|
257
|
-
}
|
|
258
|
-
} catch (err) {
|
|
259
|
-
core.warning(`Could not update MISSION.md checkboxes: ${err.message}`);
|
|
260
|
-
}
|
|
218
|
+
// Log acceptance criteria status (informational — no longer writes to MISSION.md
|
|
219
|
+
// to avoid zero-diff commits that inflate transform counts)
|
|
220
|
+
if (metIndices.length > 0) {
|
|
221
|
+
core.info(`Review found ${metIndices.length} acceptance criteria met by index: [${metIndices.join(", ")}]`);
|
|
222
|
+
}
|
|
223
|
+
if (metCriteria.length > 0) {
|
|
224
|
+
core.info(`Review found ${metCriteria.length} acceptance criteria met by text`);
|
|
261
225
|
}
|
|
262
226
|
|
|
263
227
|
return { textResultForLlm: `Review recorded: ${elements?.length || 0} elements traced, ${gaps?.length || 0} gaps found, ${totalUpdated} criteria checked` };
|
|
@@ -47,16 +47,21 @@ async function gatherAndWriteData(octokit, owner, repoName, periodStart, periodE
|
|
|
47
47
|
writeFileSync(`${REPORT_DATA_DIR}/state.toml`, stateContent);
|
|
48
48
|
writeFileSync(`${REPORT_DATA_DIR}/mission.md`, missionContent);
|
|
49
49
|
|
|
50
|
-
// 2. Workflow runs
|
|
50
|
+
// 2. Workflow runs (paginate up to 200 for long-running scenarios)
|
|
51
51
|
let workflowRuns = [];
|
|
52
52
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
for (let page = 1; page <= 2; page++) {
|
|
54
|
+
const { data } = await octokit.rest.actions.listWorkflowRunsForRepo({
|
|
55
|
+
owner, repo: repoName, per_page: 100, page, created: `${periodStart}..${periodEnd}`,
|
|
56
|
+
});
|
|
57
|
+
for (const r of data.workflow_runs) {
|
|
58
|
+
workflowRuns.push({
|
|
59
|
+
id: r.id, name: r.name, status: r.status, conclusion: r.conclusion,
|
|
60
|
+
created_at: r.created_at, updated_at: r.updated_at, html_url: r.html_url,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (data.workflow_runs.length < 100) break;
|
|
64
|
+
}
|
|
60
65
|
} catch (err) { core.warning(`Could not list runs: ${err.message}`); }
|
|
61
66
|
writeFileSync(`${REPORT_DATA_DIR}/workflow-runs.json`, JSON.stringify(workflowRuns, null, 2));
|
|
62
67
|
|