@xn-intenton-z2a/agentic-lib 7.1.40 → 7.1.41
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/README.md +0 -1
- package/bin/agentic-lib.js +1 -2
- package/package.json +1 -1
- package/src/actions/agentic-step/config-loader.js +0 -1
- package/src/actions/agentic-step/logging.js +14 -2
- package/src/actions/agentic-step/tasks/review-issue.js +23 -3
- package/src/actions/agentic-step/tasks/supervise.js +1 -2
- package/src/actions/commit-if-changed/action.yml +8 -0
- package/src/agents/agent-supervisor.md +3 -1
- package/src/agents/agentic-lib.yml +0 -3
- package/src/seeds/zero-agentic-lib.toml +0 -1
- package/src/seeds/zero-package.json +1 -1
- package/src/workflows/agent-flow-review.yml +1 -1
package/README.md
CHANGED
package/bin/agentic-lib.js
CHANGED
|
@@ -134,7 +134,7 @@ async function runTask(taskName) {
|
|
|
134
134
|
const writablePaths = getWritablePathsFromConfig(config);
|
|
135
135
|
const readOnlyPaths = getReadOnlyPathsFromConfig(config);
|
|
136
136
|
|
|
137
|
-
console.log(`[config]
|
|
137
|
+
console.log(`[config] supervisor=${config.supervisor || "daily"}`);
|
|
138
138
|
console.log(`[config] writable=${writablePaths.join(", ")}`);
|
|
139
139
|
console.log(`[config] test=${config.testScript}`);
|
|
140
140
|
console.log("");
|
|
@@ -241,7 +241,6 @@ async function loadTaskConfig() {
|
|
|
241
241
|
const { parse } = await import("smol-toml");
|
|
242
242
|
const toml = parse(readFileSync(tomlPath, "utf8"));
|
|
243
243
|
return {
|
|
244
|
-
schedule: toml.schedule?.tier || "schedule-1",
|
|
245
244
|
missionPath: toml.paths?.mission || "MISSION.md",
|
|
246
245
|
sourcePath: toml.paths?.source || "src/lib/",
|
|
247
246
|
testsPath: toml.paths?.tests || "tests/unit/",
|
package/package.json
CHANGED
|
@@ -119,7 +119,6 @@ export function loadConfig(configPath) {
|
|
|
119
119
|
const bot = toml.bot || {};
|
|
120
120
|
|
|
121
121
|
return {
|
|
122
|
-
schedule: toml.schedule?.tier || "schedule-1",
|
|
123
122
|
supervisor: toml.schedule?.supervisor || "daily",
|
|
124
123
|
model: toml.schedule?.model || "gpt-5-mini",
|
|
125
124
|
paths,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Appends structured entries to the intentïon.md activity log,
|
|
6
6
|
// including commit URLs and safety-check outcomes.
|
|
7
7
|
|
|
8
|
-
import { writeFileSync, appendFileSync, existsSync, mkdirSync } from "fs";
|
|
8
|
+
import { writeFileSync, readFileSync, appendFileSync, existsSync, mkdirSync } from "fs";
|
|
9
9
|
import { dirname } from "path";
|
|
10
10
|
import * as core from "@actions/core";
|
|
11
11
|
|
|
@@ -73,8 +73,20 @@ export function logActivity({
|
|
|
73
73
|
|
|
74
74
|
const entry = parts.join("\n");
|
|
75
75
|
|
|
76
|
+
const MAX_ENTRIES = 30;
|
|
77
|
+
|
|
76
78
|
if (existsSync(filepath)) {
|
|
77
|
-
|
|
79
|
+
// Rotate: keep only the header + last MAX_ENTRIES entries
|
|
80
|
+
const existing = readFileSync(filepath, "utf8");
|
|
81
|
+
const sections = existing.split("\n## ");
|
|
82
|
+
if (sections.length > MAX_ENTRIES + 1) {
|
|
83
|
+
// sections[0] is the header, sections[1..] are entries (prefixed with "## " after split)
|
|
84
|
+
const header = sections[0];
|
|
85
|
+
const kept = sections.slice(-(MAX_ENTRIES));
|
|
86
|
+
writeFileSync(filepath, header + "\n## " + kept.join("\n## ") + entry);
|
|
87
|
+
} else {
|
|
88
|
+
appendFileSync(filepath, entry);
|
|
89
|
+
}
|
|
78
90
|
} else {
|
|
79
91
|
writeFileSync(filepath, `# intentïon Activity Log\n${entry}`);
|
|
80
92
|
}
|
|
@@ -17,21 +17,41 @@ import { runCopilotTask, scanDirectory } from "../copilot.js";
|
|
|
17
17
|
export async function reviewIssue(context) {
|
|
18
18
|
const { octokit, repo, config, issueNumber, instructions, model } = context;
|
|
19
19
|
|
|
20
|
-
// If no specific issue, review the oldest open automated issue
|
|
20
|
+
// If no specific issue, review the oldest open automated issue that hasn't been recently reviewed
|
|
21
21
|
let targetIssueNumber = issueNumber;
|
|
22
22
|
if (!targetIssueNumber) {
|
|
23
23
|
const { data: openIssues } = await octokit.rest.issues.listForRepo({
|
|
24
24
|
...repo,
|
|
25
25
|
state: "open",
|
|
26
26
|
labels: "automated",
|
|
27
|
-
per_page:
|
|
27
|
+
per_page: 5,
|
|
28
28
|
sort: "created",
|
|
29
29
|
direction: "asc",
|
|
30
30
|
});
|
|
31
31
|
if (openIssues.length === 0) {
|
|
32
32
|
return { outcome: "nop", details: "No open automated issues to review" };
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
// Try each issue, skipping ones that already have a recent automated review comment
|
|
35
|
+
for (const candidate of openIssues) {
|
|
36
|
+
const { data: comments } = await octokit.rest.issues.listComments({
|
|
37
|
+
...repo,
|
|
38
|
+
issue_number: candidate.number,
|
|
39
|
+
per_page: 5,
|
|
40
|
+
sort: "created",
|
|
41
|
+
direction: "desc",
|
|
42
|
+
});
|
|
43
|
+
const hasRecentReview = comments.some(
|
|
44
|
+
(c) => c.body?.includes("**Automated Review Result:**") && Date.now() - new Date(c.created_at).getTime() < 86400000,
|
|
45
|
+
);
|
|
46
|
+
if (!hasRecentReview) {
|
|
47
|
+
targetIssueNumber = candidate.number;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Fall back to the oldest if all have been recently reviewed
|
|
52
|
+
if (!targetIssueNumber) {
|
|
53
|
+
targetIssueNumber = openIssues[0].number;
|
|
54
|
+
}
|
|
35
55
|
}
|
|
36
56
|
|
|
37
57
|
const { data: issue } = await octokit.rest.issues.get({
|
|
@@ -74,7 +74,6 @@ async function gatherContext(octokit, repo, config) {
|
|
|
74
74
|
issuesSummary,
|
|
75
75
|
prsSummary,
|
|
76
76
|
workflowsSummary,
|
|
77
|
-
schedule: config.schedule,
|
|
78
77
|
supervisor: config.supervisor,
|
|
79
78
|
featureIssuesWipLimit: config.featureDevelopmentIssuesWipLimit,
|
|
80
79
|
maintenanceIssuesWipLimit: config.maintenanceIssuesWipLimit,
|
|
@@ -108,7 +107,7 @@ function buildPrompt(ctx, agentInstructions) {
|
|
|
108
107
|
`### Recent Activity`,
|
|
109
108
|
ctx.recentActivity || "none",
|
|
110
109
|
"",
|
|
111
|
-
`###
|
|
110
|
+
`### Supervisor: ${ctx.supervisor}`,
|
|
112
111
|
"",
|
|
113
112
|
`### Issue Limits`,
|
|
114
113
|
`Feature development WIP limit: ${ctx.featureIssuesWipLimit}`,
|
|
@@ -28,7 +28,15 @@ runs:
|
|
|
28
28
|
git add -A
|
|
29
29
|
if git diff --cached --quiet; then
|
|
30
30
|
echo "No changes to commit"
|
|
31
|
+
elif git diff --cached --name-only | grep -qvE '(intentïon\.md|intention\.md)$'; then
|
|
32
|
+
# At least one non-log file changed — proceed with commit
|
|
33
|
+
true
|
|
31
34
|
else
|
|
35
|
+
echo "Only log files changed — skipping commit"
|
|
36
|
+
git reset HEAD -- . > /dev/null 2>&1
|
|
37
|
+
exit 0
|
|
38
|
+
fi
|
|
39
|
+
if ! git diff --cached --quiet; then
|
|
32
40
|
git commit -m "${{ inputs.commit-message }}"
|
|
33
41
|
REF="${{ inputs.push-ref }}"
|
|
34
42
|
MAX_RETRIES=3
|
|
@@ -29,7 +29,9 @@ You are the supervisor of an autonomous coding repository. Your job is to advanc
|
|
|
29
29
|
- **set-schedule:\<frequency\>** — Change the supervisor schedule. Use `weekly` when mission is substantially achieved, `continuous` to ramp up for active development.
|
|
30
30
|
- **nop** — When everything is running optimally: transform is active, issues are flowing, no failures.
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Stale Issue Detection
|
|
33
|
+
|
|
34
|
+
When open issues with the `automated` label lack the `ready` label and are more than 1 day old, and review has run without adding labels, use `github:label-issue` to add the `ready` label directly. Don't wait for review to fix itself — if issues are stuck without `ready` for more than a cycle, label them so transform can pick them up.
|
|
33
35
|
|
|
34
36
|
## Mission Lifecycle
|
|
35
37
|
|