@xn-intenton-z2a/agentic-lib 7.2.6 → 7.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.
package/README.md CHANGED
@@ -73,7 +73,7 @@ your-repo/
73
73
  │ │
74
74
  │ └── agentic-lib/ # [INIT] Internal infrastructure (always overwritten)
75
75
  │ ├── actions/
76
- │ │ ├── agentic-step/ # The Copilot SDK action (9 task handlers)
76
+ │ │ ├── agentic-step/ # The Copilot SDK action (10 task handlers)
77
77
  │ │ ├── commit-if-changed/ # Composite: conditional git commit
78
78
  │ │ └── setup-npmrc/ # Composite: npm registry auth
79
79
  │ ├── agents/ # 8 prompt files + config YAML
@@ -212,6 +212,7 @@ The core of the system is a single GitHub Action that handles all autonomous tas
212
212
  | Task | Purpose |
213
213
  |------|---------|
214
214
  | `supervise` | Gather repo context, choose and dispatch actions strategically |
215
+ | `direct` | Evaluate mission status: complete, failed, or gap analysis |
215
216
  | `transform` | Transform the codebase toward the mission |
216
217
  | `resolve-issue` | Read an issue and generate code to resolve it |
217
218
  | `fix-code` | Fix failing tests or lint errors |
@@ -242,9 +243,8 @@ All task commands accept these flags:
242
243
  | `--dry-run` | off | Show the prompt without calling the Copilot SDK |
243
244
  | `--target <path>` | current directory | Target repository to transform |
244
245
  | `--model <name>` | `claude-sonnet-4` | Copilot SDK model |
245
- | `--cycles <N>` | from budget | Max iteration cycles (iterate only) |
246
- | `--steps <list>` | all three | Comma-separated steps per cycle (iterate only) |
247
246
  | `--mission <name>` | hamming-distance | Init with --purge before iterating (iterate only) |
247
+ | `--timeout <ms>` | 600000 | Session timeout in milliseconds (iterate only) |
248
248
 
249
249
  ### Example: Full Walkthrough
250
250
 
@@ -299,25 +299,96 @@ npx @xn-intenton-z2a/agentic-lib transform --dry-run
299
299
 
300
300
  ### Iterator
301
301
 
302
- The `iterate` command runs multiple cycles of maintain transform fix with automatic stop conditions and budget tracking:
302
+ The `iterate` command runs a single persistent Copilot SDK session that autonomously implements your mission reading code, writing implementations and tests, running tests, and iterating until everything passes.
303
303
 
304
304
  ```bash
305
- # Init a mission and iterate with default budget
306
- npx @xn-intenton-z2a/agentic-lib iterate --mission fizz-buzz --model gpt-5-mini
305
+ # Init a mission and iterate
306
+ npx @xn-intenton-z2a/agentic-lib iterate --mission hamming-distance --model gpt-5-mini
307
307
 
308
- # Run 4 cycles on an existing workspace
309
- npx @xn-intenton-z2a/agentic-lib iterate --cycles 4
308
+ # Iterate on an existing workspace
309
+ npx @xn-intenton-z2a/agentic-lib iterate --target /path/to/workspace
310
310
 
311
- # Transform-only cycles (skip maintain)
312
- npx @xn-intenton-z2a/agentic-lib iterate --steps transform,fix-code --cycles 3
311
+ # With a longer timeout (10 minutes)
312
+ npx @xn-intenton-z2a/agentic-lib iterate --mission fizz-buzz --timeout 600000
313
313
  ```
314
314
 
315
- **Stop conditions:**
316
- - Tests pass for 2 consecutive cycles
317
- - No files change for 2 consecutive cycles
318
- - Transformation budget exhausted (configurable via `transformation-budget` in `agentic-lib.toml`)
315
+ The session uses SDK hooks for observability (tool call tracking, error recovery) and infinite sessions for context management. The agent drives its own read-write-test loop until the mission is complete or the timeout is reached.
319
316
 
320
- Each cycle logs `**agentic-lib transformation cost:** 1` to `intentïon.md` when source files change. The iterator reads these to track cumulative cost against the budget.
317
+ **Available missions:** hamming-distance, fizz-buzz, roman-numerals, string-utils, cron-engine, dense-encoding, markdown-compiler, and more (see `src/seeds/missions/`).
318
+
319
+ ### Running Local Benchmarks
320
+
321
+ You can benchmark mission completion locally without GitHub Actions. This is useful for comparing models, tuning profiles, and measuring iteration speed.
322
+
323
+ **Prerequisites:**
324
+
325
+ 1. A `COPILOT_GITHUB_TOKEN` (fine-grained PAT with Copilot read permission)
326
+ 2. Node.js 24+
327
+
328
+ **Setup:**
329
+
330
+ ```bash
331
+ # Set your token
332
+ export COPILOT_GITHUB_TOKEN=github_pat_...
333
+
334
+ # Or source from .env
335
+ source .env
336
+ ```
337
+
338
+ **Run a benchmark:**
339
+
340
+ ```bash
341
+ # Quick: hamming-distance with gpt-5-mini (simplest mission, ~1-2 min)
342
+ npx @xn-intenton-z2a/agentic-lib iterate \
343
+ --mission hamming-distance --model gpt-5-mini --timeout 300000
344
+
345
+ # Medium: roman-numerals with claude-sonnet-4
346
+ npx @xn-intenton-z2a/agentic-lib iterate \
347
+ --mission roman-numerals --model claude-sonnet-4
348
+
349
+ # Complex: string-utils with gpt-4.1 (10 functions, longer timeout)
350
+ npx @xn-intenton-z2a/agentic-lib iterate \
351
+ --mission string-utils --model gpt-4.1 --timeout 600000
352
+ ```
353
+
354
+ **From a local clone** (development):
355
+
356
+ ```bash
357
+ # From the agentic-lib directory
358
+ npx . iterate --mission hamming-distance --model gpt-5-mini --target /tmp/bench
359
+
360
+ # Or link globally
361
+ npm link
362
+ agentic-lib iterate --mission hamming-distance --model gpt-5-mini --target /tmp/bench
363
+ ```
364
+
365
+ **Output:**
366
+
367
+ ```
368
+ === agentic-lib iterate ===
369
+ Target: /tmp/bench
370
+ Model: gpt-5-mini
371
+
372
+ [hybrid] Creating session (model=gpt-5-mini, workspace=/tmp/bench)
373
+ [hybrid] Session: sess_abc123
374
+ [tool] read_file
375
+ [tool] read_file
376
+ [tool] write_file
377
+ [tool] run_tests
378
+ [tool] write_file
379
+ [tool] run_tests
380
+
381
+ === Results ===
382
+ Success: true
383
+ Tests passed: true
384
+ Session time: 47s
385
+ Total time: 52s
386
+ Tool calls: 6
387
+ Test runs: 2
388
+ Files written: 2
389
+ Tokens: 12400 (in=9200 out=3200)
390
+ End reason: complete
391
+ ```
321
392
 
322
393
  ### Environment
323
394
 
@@ -367,14 +438,14 @@ This repository is the source for the `@xn-intenton-z2a/agentic-lib` npm package
367
438
  src/
368
439
  ├── workflows/ 8 GitHub Actions workflow templates
369
440
  ├── actions/ 3 composite/SDK actions (agentic-step, commit-if-changed, setup-npmrc)
370
- ├── agents/ 8 agent prompt files + 1 config
441
+ ├── agents/ 9 agent prompt files + 1 config
371
442
  ├── seeds/ 7 seed files (test.yml + 6 project seed files for --purge reset)
372
443
  └── scripts/ 7 utility scripts distributed to consumers
373
444
  ```
374
445
 
375
446
  ### Testing
376
447
 
377
- 393 unit tests across 26 test files, plus system tests:
448
+ 431 unit tests across 27 test files, plus system tests:
378
449
 
379
450
  ```bash
380
451
  npm test # Run all tests (vitest)