@xn-intenton-z2a/agentic-lib 7.1.30 → 7.1.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xn-intenton-z2a/agentic-lib",
3
- "version": "7.1.30",
3
+ "version": "7.1.32",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -76,6 +76,8 @@ async function gatherContext(octokit, repo, config) {
76
76
  workflowsSummary,
77
77
  schedule: config.schedule,
78
78
  supervisor: config.supervisor,
79
+ featureIssuesWipLimit: config.featureDevelopmentIssuesWipLimit,
80
+ maintenanceIssuesWipLimit: config.maintenanceIssuesWipLimit,
79
81
  };
80
82
  }
81
83
 
@@ -108,6 +110,11 @@ function buildPrompt(ctx, agentInstructions) {
108
110
  "",
109
111
  `### Schedule: ${ctx.schedule}, Supervisor: ${ctx.supervisor}`,
110
112
  "",
113
+ `### Issue Limits`,
114
+ `Feature development WIP limit: ${ctx.featureIssuesWipLimit}`,
115
+ `Maintenance WIP limit: ${ctx.maintenanceIssuesWipLimit}`,
116
+ `Open issues: ${ctx.issuesSummary.length} (capacity for ${Math.max(0, ctx.featureIssuesWipLimit - ctx.issuesSummary.length)} more)`,
117
+ "",
111
118
  "## Available Actions",
112
119
  "Pick one or more actions. Output them in the format below.",
113
120
  "",
@@ -1,25 +1,32 @@
1
1
  You are the supervisor of an autonomous coding repository. Your job is to advance the mission by strategically choosing which workflows to dispatch and which GitHub actions to take.
2
2
 
3
+ ## Priority Order
4
+
5
+ 1. **Create issues when the backlog is low** — if fewer than 3 open issues exist, create at least 1 new issue from the features list or mission before dispatching workflows. The pipeline stalls without issues to work on. Always include descriptive titles and the `automated` label.
6
+ 2. **Dispatch transform when ready issues exist** — transform is where code gets written. Always prefer it over maintain when there are open issues with the `ready` label.
7
+ 3. **Dispatch review after transform** — when recent workflow runs show a transform completion, dispatch review to close resolved issues and add `ready` labels to new issues. This keeps the pipeline flowing.
8
+ 4. **Fix failing PRs** — dispatch fix-code for any PR with failing checks (include pr-number).
9
+ 5. **Dispatch maintain sparingly** — only when features or library docs need refreshing AND no maintain has run in the last 3 workflow runs. Maintain is low-value if features are already populated.
10
+
3
11
  ## Decision Framework
4
12
 
5
13
  1. **Check what's already in progress** — don't duplicate work. If a transform is running, don't dispatch another.
6
- 2. **Prioritise unblocking** — fix failing PRs before starting new features. Close resolved issues to free capacity.
7
- 3. **Balance the pipeline** — maintain a healthy mix of feature work, maintenance, and review.
8
- 4. **Respect limits** — don't create issues beyond the WIP limit. Don't dispatch workflows that will fail due to missing prerequisites.
9
- 5. **Be strategic about timing** — if the schedule is hourly, you can afford to spread work across cycles. If daily, batch more aggressively.
14
+ 2. **Prioritise code generation** — the goal is working code. Prefer actions that produce code (transform, fix-code) over metadata (maintain, label).
15
+ 3. **Keep the issue pipeline full** — the biggest bottleneck is running out of open issues. Proactively create issues when capacity allows.
16
+ 4. **Respect limits** — don't create issues beyond the WIP limit shown in the context. Don't dispatch workflows that will fail due to missing prerequisites.
10
17
 
11
18
  ## When to use each action
12
19
 
13
- - **dispatch:agent-flow-transform** — When there are open issues ready to work on and no transform is currently running.
14
- - **dispatch:agent-flow-maintain** — When features or library docs are below their limits, or haven't been refreshed recently.
15
- - **dispatch:agent-flow-review** — When there are open automated issues that might be resolved, or issues that need better acceptance criteria.
20
+ - **github:create-issue** — When open issues < WIP limit. Derive the issue title from unimplemented features or mission goals. Always include relevant labels (`automated`, `enhancement`).
21
+ - **dispatch:agent-flow-transform** — When there are open issues with the `ready` label and no transform is currently running.
22
+ - **dispatch:agent-flow-review** — After observing a recent transform completion, or when there are unenhanced issues needing the `ready` label.
16
23
  - **dispatch:agent-flow-fix-code** — When a specific PR has failing checks. Always include the pr-number.
24
+ - **dispatch:agent-flow-maintain** — When features are below their limit AND no maintain appears in the last 3 workflow runs.
17
25
  - **dispatch:agent-discussions-bot** — When you want to proactively engage in discussions or respond to a user request.
18
- - **github:create-issue** — When you identify a gap between the mission and current features. Always include a descriptive title and relevant labels.
19
26
  - **github:label-issue** — When an issue needs better categorisation for prioritisation.
20
27
  - **github:close-issue** — When an issue is clearly resolved or no longer relevant.
21
28
  - **respond:discussions** — When replying to a user request that came through the discussions bot. Include the discussion URL and a clear message.
22
- - **nop** — When everything is running smoothly and no intervention is needed.
29
+ - **nop** — When everything is running optimally: transform is active, issues are flowing, no failures.
23
30
 
24
31
  ## Guidelines
25
32
 
@@ -28,3 +35,4 @@ You are the supervisor of an autonomous coding repository. Your job is to advanc
28
35
  - When a user has made a request via discussions, prioritise responding to it.
29
36
  - Don't dispatch the same workflow twice in one cycle.
30
37
  - If recent workflow runs show failures, investigate before dispatching more work.
38
+ - Creating an issue + dispatching review in the same cycle is a good pattern: review will enhance the new issue with acceptance criteria and the `ready` label.
@@ -27,7 +27,7 @@ test = "npm test"
27
27
  start = "npm run start"
28
28
 
29
29
  [limits]
30
- feature-issues = 2
30
+ feature-issues = 5
31
31
  maintenance-issues = 1
32
32
  attempts-per-branch = 3
33
33
  attempts-per-issue = 2
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@xn-intenton-z2a/agentic-lib": "^7.1.30"
17
+ "@xn-intenton-z2a/agentic-lib": "^7.1.32"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.0",
@@ -12,7 +12,7 @@
12
12
  # 2. Proactive (supervise job): LLM-driven strategic decisions via agentic-step.
13
13
  # - Gathers full repo context (issues, PRs, workflows, features, activity)
14
14
  # - Chooses actions: dispatch workflows, create/label/close issues, respond to discussions
15
- # - Runs on workflow_dispatch or schedule (set via agent-supervisor-schedule.yml)
15
+ # - Runs on every trigger (workflow_run, workflow_dispatch, schedule)
16
16
 
17
17
  name: agent-supervisor
18
18
  run-name: "agent-supervisor [${{ github.ref_name }}]"
@@ -23,6 +23,8 @@ on:
23
23
  - test
24
24
  - agent-flow-transform
25
25
  - agent-flow-fix-code
26
+ - agent-flow-maintain
27
+ - agent-flow-review
26
28
  - ci-automerge
27
29
  types:
28
30
  - completed
@@ -172,10 +174,25 @@ jobs:
172
174
  core.warning(`Stale PR check failed: ${err.message}`);
173
175
  }
174
176
 
177
+ // ─── 3. Successful transform → dispatch review ────────────────
178
+ try {
179
+ if (workflowRun && workflowName === 'agent-flow-transform' && conclusion === 'success') {
180
+ core.info('Transform completed successfully — dispatching review to close resolved issues and enhance new ones.');
181
+ await github.rest.actions.createWorkflowDispatch({
182
+ owner, repo,
183
+ workflow_id: 'agent-flow-review.yml',
184
+ ref: 'main',
185
+ inputs: {},
186
+ });
187
+ }
188
+ } catch (err) {
189
+ core.warning(`Post-transform review dispatch failed: ${err.message}`);
190
+ }
191
+
175
192
  # ─── Proactive: LLM-driven strategic decisions ───────────────────────
176
193
  supervise:
177
194
  needs: params
178
- if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
195
+ if: always() && needs.params.result == 'success'
179
196
  runs-on: ubuntu-latest
180
197
  steps:
181
198
  - uses: actions/checkout@v4