ai-dev-workflow 0.2.0__tar.gz → 0.3.1__tar.gz
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.
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/PKG-INFO +227 -8
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/README.md +226 -7
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/pyproject.toml +12 -1
- ai_dev_workflow-0.3.1/tests/test_active_work_context.py +48 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_ado_provider.py +31 -1
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_ai_provider.py +17 -0
- ai_dev_workflow-0.3.1/tests/test_ai_workflow_cli.py +188 -0
- ai_dev_workflow-0.3.1/tests/test_codex_cloud_executor.py +206 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_composite_work_item.py +29 -1
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_connection_and_mcp.py +24 -4
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_general_init.py +40 -1
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_instruction_adapter.py +5 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_issue_publisher.py +60 -4
- ai_dev_workflow-0.3.1/tests/test_planning_approval.py +58 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_queue_dispatcher.py +127 -25
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_setup_wizard.py +75 -7
- ai_dev_workflow-0.3.1/tests/test_work_breakdown.py +83 -0
- ai_dev_workflow-0.3.1/tests/test_work_claim.py +64 -0
- ai_dev_workflow-0.3.1/tests/test_worker_presence.py +97 -0
- ai_dev_workflow-0.3.1/tests/test_worker_registry.py +191 -0
- ai_dev_workflow-0.3.1/tests/test_worker_runtime_manager.py +89 -0
- ai_dev_workflow-0.3.1/tests/test_workflow_handoff.py +108 -0
- ai_dev_workflow-0.3.1/tests/test_workflow_runtime.py +147 -0
- ai_dev_workflow-0.3.1/tools/active_work_context.py +128 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ado_provider.py +91 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ai_dev_workflow.egg-info/PKG-INFO +227 -8
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ai_dev_workflow.egg-info/SOURCES.txt +19 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ai_dev_workflow.egg-info/top_level.txt +11 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ai_provider.py +9 -1
- ai_dev_workflow-0.3.1/tools/ai_workflow_cli.py +2231 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/composite_work_item.py +33 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/github_work_item_provider.py +37 -1
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/instruction_adapter.py +5 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/issue_publisher.py +84 -4
- ai_dev_workflow-0.3.1/tools/planning_approval.py +60 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/setup_wizard.py +269 -49
- ai_dev_workflow-0.3.1/tools/skill_registry.py +43 -0
- ai_dev_workflow-0.3.1/tools/source_connection.py +101 -0
- ai_dev_workflow-0.3.1/tools/work_breakdown.py +133 -0
- ai_dev_workflow-0.3.1/tools/work_claim.py +246 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/work_item_provider.py +2 -0
- ai_dev_workflow-0.3.1/tools/worker_identity.py +95 -0
- ai_dev_workflow-0.3.1/tools/worker_presence.py +167 -0
- ai_dev_workflow-0.3.1/tools/worker_registry.py +363 -0
- ai_dev_workflow-0.3.1/tools/worker_runtime_manager.py +223 -0
- ai_dev_workflow-0.3.1/tools/worker_session.py +50 -0
- ai_dev_workflow-0.3.1/tools/workflow_handoff.py +132 -0
- ai_dev_workflow-0.3.1/tools/workflow_runtime.py +167 -0
- ai_dev_workflow-0.2.0/tests/test_ai_workflow_cli.py +0 -62
- ai_dev_workflow-0.2.0/tests/test_codex_cloud_executor.py +0 -82
- ai_dev_workflow-0.2.0/tests/test_worker_registry.py +0 -69
- ai_dev_workflow-0.2.0/tools/ai_workflow_cli.py +0 -825
- ai_dev_workflow-0.2.0/tools/source_connection.py +0 -21
- ai_dev_workflow-0.2.0/tools/worker_registry.py +0 -170
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/setup.cfg +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_bootstrap_project.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_codespaces_environment.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_framework_update.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_package_install.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tests/test_planning_context.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ado_mcp.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ai_dev_workflow.egg-info/dependency_links.txt +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ai_dev_workflow.egg-info/entry_points.txt +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/ai_dev_workflow.egg-info/requires.txt +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/framework_update.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/planning_context.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/setup_context.py +0 -0
- {ai_dev_workflow-0.2.0 → ai_dev_workflow-0.3.1}/tools/work_item_registry.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ai-dev-workflow
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Provider-neutral AI-assisted development workflow and CLI
|
|
5
5
|
Author: vuthethienlong
|
|
6
6
|
Project-URL: Homepage, https://github.com/vuthethienlong/ai-dev-workflow
|
|
@@ -16,7 +16,7 @@ Requires-Dist: PyYAML>=6.0
|
|
|
16
16
|
|
|
17
17
|
Reusable, provider-neutral workflow for AI-assisted software development.
|
|
18
18
|
|
|
19
|
-
This repository
|
|
19
|
+
This repository provides a reusable, provider-neutral AI development workflow with first-class brainstorming, spec, ADR, implementation plan, tests, PR evidence and runtime verification artifacts.
|
|
20
20
|
|
|
21
21
|
## Default lifecycle
|
|
22
22
|
|
|
@@ -30,7 +30,7 @@ Brainstorm
|
|
|
30
30
|
-> RED
|
|
31
31
|
-> ImplementerAgent implements
|
|
32
32
|
-> GREEN + regression
|
|
33
|
-
-> ReviewerAgent (
|
|
33
|
+
-> ReviewerAgent (automatic independent review by default)
|
|
34
34
|
-> Integration
|
|
35
35
|
-> Runtime verification batch when required
|
|
36
36
|
-> Promotion / Done
|
|
@@ -41,7 +41,7 @@ Brainstorm
|
|
|
41
41
|
- `ArchitectAgent`: brainstorm, spec, ADR and acceptance criteria.
|
|
42
42
|
- `TesterAgent`: derives tests from the frozen contract and proves RED before implementation.
|
|
43
43
|
- `ImplementerAgent`: implements without changing the frozen test contract; must reach GREEN and run applicable regression checks.
|
|
44
|
-
- `ReviewerAgent`:
|
|
44
|
+
- `ReviewerAgent`: automatic semantic/architecture reviewer by default; must use a different worker_id from the Implementer. Separate credential/identity is optional.
|
|
45
45
|
- `RuntimeVerifierAgent`: optional, project-specific runtime verification role.
|
|
46
46
|
|
|
47
47
|
A role is not a model. GPT, Codex, Claude, local models or future providers are replaceable adapters under these contracts.
|
|
@@ -52,7 +52,7 @@ A role is not a model. GPT, Codex, Claude, local models or future providers are
|
|
|
52
52
|
- `Ready` is the commitment/freeze boundary.
|
|
53
53
|
- Test design happens before implementation.
|
|
54
54
|
- Implementer may report a bad test/spec as blocked, but must not rewrite expectations merely to make tests pass.
|
|
55
|
-
- Deterministic CI gates run before
|
|
55
|
+
- Deterministic CI gates run before automatic independent semantic review.
|
|
56
56
|
- Runtime verification is separate from offline/CI verification.
|
|
57
57
|
- Projects consume versioned reusable workflows such as `@v1`; they do not copy the engine.
|
|
58
58
|
|
|
@@ -70,6 +70,8 @@ project tests/runtime rules
|
|
|
70
70
|
|
|
71
71
|
Its caller workflow will reference this repository's reusable workflow.
|
|
72
72
|
|
|
73
|
+
The framework does **not** install its own CI/check workflow into consumer repositories, does not configure required status checks, and does not modify branch protection. Existing consumer-repository build, test, lint, security, approval, and merge policies remain authoritative. The generated `.github/workflows/ai-workflow.yml` is orchestration only.
|
|
74
|
+
|
|
73
75
|
See:
|
|
74
76
|
- `AGENTS.md`
|
|
75
77
|
- `docs/lifecycle.md`
|
|
@@ -278,7 +280,7 @@ Local stdio MCP remains available with `--ado-mcp-mode local`. Supported MCP aut
|
|
|
278
280
|
|
|
279
281
|
## Worker registration
|
|
280
282
|
|
|
281
|
-
Setup can register local, Codespaces, or cloud workers separately from AI provider configuration.
|
|
283
|
+
Setup can register local, Codespaces, or cloud workers separately from AI provider configuration. Worker IDs are independent from credential identities, so multiple workers may share one credential reference.
|
|
282
284
|
|
|
283
285
|
Example local hybrid worker:
|
|
284
286
|
|
|
@@ -326,14 +328,28 @@ Use `./bin/ai-workflow update --check` to inspect the configured framework ref,
|
|
|
326
328
|
|
|
327
329
|
## Install from PyPI
|
|
328
330
|
|
|
329
|
-
|
|
331
|
+
Consumers do not need to clone this repository:
|
|
330
332
|
|
|
331
333
|
```bash
|
|
332
334
|
python -m pip install --upgrade ai-dev-workflow
|
|
333
|
-
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
After installation, start with the built-in guide:
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
ai-workflow guide
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Typical first-run flow:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
cd /path/to/project
|
|
334
347
|
ai-workflow setup
|
|
348
|
+
ai-workflow doctor
|
|
335
349
|
```
|
|
336
350
|
|
|
351
|
+
The setup wizard detects the containing Git repository by default, shows the generated plan/configuration, and prints the next required steps after apply. Use `ai-workflow setup --help` for setup options and `ai-workflow guide` at any time for the end-to-end usage flow.
|
|
352
|
+
|
|
337
353
|
The GitHub repository may remain private because normal consumers install the built distribution from PyPI rather than cloning the source repository.
|
|
338
354
|
|
|
339
355
|
On another machine, install Python 3.10+ and run the same `pip install ai-dev-workflow` command. Project-specific configuration remains in each consumer repository.
|
|
@@ -346,3 +362,206 @@ ai-workflow update
|
|
|
346
362
|
```
|
|
347
363
|
|
|
348
364
|
The first command upgrades the installed CLI package. The second migrates/updates the workflow installation in the current project.
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
## PM and architecture planning
|
|
368
|
+
|
|
369
|
+
Product planning and technical architecture are separate roles:
|
|
370
|
+
|
|
371
|
+
```text
|
|
372
|
+
Idea / chat
|
|
373
|
+
→ PMAgent
|
|
374
|
+
→ product Keep/Split/Merge proposal
|
|
375
|
+
→ human approval
|
|
376
|
+
→ ArchitectAgent
|
|
377
|
+
→ technical Spec / ADR / decomposition
|
|
378
|
+
→ approval for structural architecture changes
|
|
379
|
+
→ Ready Freeze
|
|
380
|
+
→ TesterAgent
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
PMAgent owns what/why: intent, value, scope, priority, product acceptance boundaries, Epic/Issue classification and product-level decomposition. ArchitectAgent owns how: technical boundaries, interfaces, data model, Spec/ADR, technical dependencies and execution decomposition.
|
|
384
|
+
|
|
385
|
+
By default `workflow.planning.approval_policy` is `always`. Create, Split, Merge, Re-parent and Ready Freeze require explicit approval before provider mutation, and frozen contracts cannot be silently changed.
|
|
386
|
+
|
|
387
|
+
## Active work and claims
|
|
388
|
+
|
|
389
|
+
A selected task is not considered started until its worker/provider acknowledges it:
|
|
390
|
+
|
|
391
|
+
```text
|
|
392
|
+
ready/queued
|
|
393
|
+
-> reserved
|
|
394
|
+
-> offered
|
|
395
|
+
-> accepted by worker/provider
|
|
396
|
+
-> claim committed
|
|
397
|
+
-> active status
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Local agents acknowledge with the registered worker identity (for example through `ai-workflow claim`). Phase completion can be recorded with `ai-workflow complete-phase`, which releases the current claim and reserves an eligible worker for the next role. Automatic review always excludes the implementation worker_id; identity separation is enforced only when the optional strict-review policy is enabled.
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
## Azure DevOps configuration boundary
|
|
404
|
+
|
|
405
|
+
Azure DevOps project metadata and credentials are separate:
|
|
406
|
+
|
|
407
|
+
- project configuration owns organization/project, logical Epic/Issue Work Item Type mappings, and Area/Iteration defaults;
|
|
408
|
+
- worker configuration owns the Azure DevOps authentication strategy/credential reference;
|
|
409
|
+
- setup may borrow a worker credential temporarily to discover project metadata, but never persists the raw token;
|
|
410
|
+
- workers may share a credential reference when they intentionally act as the same ADO identity.
|
|
411
|
+
|
|
412
|
+
Area Path and Iteration Path options are discovered from the project's existing Azure DevOps classification nodes. Setup selects from existing values; it does not create or modify the project's classification hierarchy.
|
|
413
|
+
|
|
414
|
+
## Worker credentials and identity
|
|
415
|
+
|
|
416
|
+
Worker IDs and credentials are separate concepts. Several workers may intentionally use the same credential reference and therefore operate as the same GitHub/ADO actor. This is valid for normal planning, testing, implementation, and runtime work.
|
|
417
|
+
|
|
418
|
+
The workflow verifies effective actor identity where possible. A distinct credential is not required merely because workers are different. By default, ReviewerAgent only needs a different worker_id from the Implementer. Projects that require stronger separation may enable `reviewer.require_distinct_identity: true`.
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
## Local parallel workers
|
|
422
|
+
|
|
423
|
+
One local machine may register multiple workers that intentionally share the same GitHub/Azure DevOps credential sessions while using isolated working folders.
|
|
424
|
+
|
|
425
|
+
Example:
|
|
426
|
+
|
|
427
|
+
```yaml
|
|
428
|
+
workers:
|
|
429
|
+
- worker_id: codex-01
|
|
430
|
+
environment: local
|
|
431
|
+
provider: codex
|
|
432
|
+
workspace:
|
|
433
|
+
strategy: git-worktree
|
|
434
|
+
root: G:\ai-workers\codex-01
|
|
435
|
+
|
|
436
|
+
- worker_id: ccr-01
|
|
437
|
+
environment: local
|
|
438
|
+
provider: ccr
|
|
439
|
+
workspace:
|
|
440
|
+
strategy: git-worktree
|
|
441
|
+
root: G:\ai-workers\ccr-01
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Add another local worker after initial setup:
|
|
445
|
+
|
|
446
|
+
```powershell
|
|
447
|
+
ai-workflow add-worker
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
or non-interactively:
|
|
451
|
+
|
|
452
|
+
```powershell
|
|
453
|
+
ai-workflow add-worker `
|
|
454
|
+
--worker-id codex-02 `
|
|
455
|
+
--provider codex `
|
|
456
|
+
--mode hybrid `
|
|
457
|
+
--workspace G:\ai-workers\codex-02 `
|
|
458
|
+
--workspace-strategy git-worktree
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
By default the new local worker inherits credential references from an existing local worker. It still receives its own `worker_id` and isolated workspace. Use `--no-inherit-credentials` when the worker must use a different identity.
|
|
462
|
+
|
|
463
|
+
At runtime, a local worker is resolved in this order:
|
|
464
|
+
|
|
465
|
+
1. explicit `--worker <id>`;
|
|
466
|
+
2. `AI_WORKFLOW_WORKER_ID`;
|
|
467
|
+
3. current working directory contained by one configured `workspace.root`.
|
|
468
|
+
|
|
469
|
+
This makes it possible to open separate terminals in separate worker folders and run tasks concurrently without repeating the worker ID.
|
|
470
|
+
|
|
471
|
+
## Claude Code Router local provider
|
|
472
|
+
|
|
473
|
+
Claude Code Router can be registered as a local provider:
|
|
474
|
+
|
|
475
|
+
```yaml
|
|
476
|
+
providers:
|
|
477
|
+
ccr:
|
|
478
|
+
type: claude-code-router
|
|
479
|
+
base_url: http://127.0.0.1:3456
|
|
480
|
+
auth:
|
|
481
|
+
type: none
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
The gateway defaults to `http://127.0.0.1:3456`. A client-key environment reference can be configured when the local router is protected. Claude Code Router uses the same `CLAUDE.md` instruction adapter as Claude Code, while `AGENTS.md` remains the shared workflow instruction source.
|
|
485
|
+
|
|
486
|
+
A local CCR worker can then be registered with its own workspace:
|
|
487
|
+
|
|
488
|
+
```powershell
|
|
489
|
+
ai-workflow add-worker `
|
|
490
|
+
--worker-id ccr-01 `
|
|
491
|
+
--provider ccr `
|
|
492
|
+
--workspace G:\ai-workers\ccr-01
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
### Step-by-step add-worker wizard
|
|
497
|
+
|
|
498
|
+
Running `ai-workflow add-worker` with no `--non-interactive` flag now opens a structured wizard:
|
|
499
|
+
|
|
500
|
+
1. review existing project/provider configuration;
|
|
501
|
+
2. choose a worker id;
|
|
502
|
+
3. choose planner/executor/hybrid mode;
|
|
503
|
+
4. choose an existing AI provider;
|
|
504
|
+
5. choose roles;
|
|
505
|
+
6. choose the local workspace folder;
|
|
506
|
+
7. choose `git-worktree` or `folder` workspace strategy;
|
|
507
|
+
8. choose whether to inherit an existing local worker's credential references or configure separate GitHub/ADO references;
|
|
508
|
+
9. choose skills and capacity;
|
|
509
|
+
10. review the final worker configuration and confirm before saving.
|
|
510
|
+
|
|
511
|
+
The wizard never stores raw tokens. It only stores credential strategies/references already supported by the worker identity model.
|
|
512
|
+
|
|
513
|
+
For scripting/automation, keep the deterministic flag-based flow:
|
|
514
|
+
|
|
515
|
+
```powershell
|
|
516
|
+
ai-workflow add-worker `
|
|
517
|
+
--non-interactive `
|
|
518
|
+
--worker-id codex-02 `
|
|
519
|
+
--provider codex `
|
|
520
|
+
--mode hybrid `
|
|
521
|
+
--roles "ArchitectAgent|TesterAgent|ImplementerAgent|ReviewerAgent" `
|
|
522
|
+
--workspace G:\ai-workers\codex-02 `
|
|
523
|
+
--workspace-strategy git-worktree
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
Use `--no-inherit-credentials` when the new worker must not reuse an existing local worker's credential references.
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
## Consumer worker registry and live presence
|
|
530
|
+
|
|
531
|
+
When a GitHub Issues or composite project has execution workers, setup writes:
|
|
532
|
+
|
|
533
|
+
```text
|
|
534
|
+
.github/ai-workflow-worker-registry.json
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
This committed registry contains routing metadata only:
|
|
538
|
+
|
|
539
|
+
- worker id;
|
|
540
|
+
- execution location;
|
|
541
|
+
- provider id;
|
|
542
|
+
- roles/capabilities;
|
|
543
|
+
- capacity;
|
|
544
|
+
- managed/unmanaged flag;
|
|
545
|
+
- GitHub assignee when required.
|
|
546
|
+
|
|
547
|
+
It intentionally excludes machine-local paths, machine ids, client launch commands, credential references, tokens, identities, heartbeat data, and active sessions.
|
|
548
|
+
|
|
549
|
+
For local execution workers, setup also creates or reuses one closed coordination Issue marked with:
|
|
550
|
+
|
|
551
|
+
```text
|
|
552
|
+
<!-- ai-dev-workflow:worker-presence -->
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
The Issue number is stored as project-level dispatcher metadata. Local workers publish the existing queue-dispatcher presence-v2 contract to that Issue using their own verified GitHub identity.
|
|
556
|
+
|
|
557
|
+
`ai-workflow worker open <worker-id>` keeps the local and central heartbeat alive while the configured Codex/Claude Code client process is running. When the client exits, the worker is reported offline.
|
|
558
|
+
|
|
559
|
+
For headless or daemon-style workers:
|
|
560
|
+
|
|
561
|
+
```powershell
|
|
562
|
+
ai-workflow worker serve <worker-id>
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
A worker keeps one presence comment and updates it on each heartbeat; it does not append a new comment every interval. The central dispatcher reads the consumer registry plus live presence before reserving work.
|
|
566
|
+
|
|
567
|
+
The consumer orchestration workflow remains `.github/workflows/ai-workflow.yml`. This integration does not install framework CI/check workflows, does not configure required status checks, and does not modify branch protection.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Reusable, provider-neutral workflow for AI-assisted software development.
|
|
4
4
|
|
|
5
|
-
This repository
|
|
5
|
+
This repository provides a reusable, provider-neutral AI development workflow with first-class brainstorming, spec, ADR, implementation plan, tests, PR evidence and runtime verification artifacts.
|
|
6
6
|
|
|
7
7
|
## Default lifecycle
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ Brainstorm
|
|
|
16
16
|
-> RED
|
|
17
17
|
-> ImplementerAgent implements
|
|
18
18
|
-> GREEN + regression
|
|
19
|
-
-> ReviewerAgent (
|
|
19
|
+
-> ReviewerAgent (automatic independent review by default)
|
|
20
20
|
-> Integration
|
|
21
21
|
-> Runtime verification batch when required
|
|
22
22
|
-> Promotion / Done
|
|
@@ -27,7 +27,7 @@ Brainstorm
|
|
|
27
27
|
- `ArchitectAgent`: brainstorm, spec, ADR and acceptance criteria.
|
|
28
28
|
- `TesterAgent`: derives tests from the frozen contract and proves RED before implementation.
|
|
29
29
|
- `ImplementerAgent`: implements without changing the frozen test contract; must reach GREEN and run applicable regression checks.
|
|
30
|
-
- `ReviewerAgent`:
|
|
30
|
+
- `ReviewerAgent`: automatic semantic/architecture reviewer by default; must use a different worker_id from the Implementer. Separate credential/identity is optional.
|
|
31
31
|
- `RuntimeVerifierAgent`: optional, project-specific runtime verification role.
|
|
32
32
|
|
|
33
33
|
A role is not a model. GPT, Codex, Claude, local models or future providers are replaceable adapters under these contracts.
|
|
@@ -38,7 +38,7 @@ A role is not a model. GPT, Codex, Claude, local models or future providers are
|
|
|
38
38
|
- `Ready` is the commitment/freeze boundary.
|
|
39
39
|
- Test design happens before implementation.
|
|
40
40
|
- Implementer may report a bad test/spec as blocked, but must not rewrite expectations merely to make tests pass.
|
|
41
|
-
- Deterministic CI gates run before
|
|
41
|
+
- Deterministic CI gates run before automatic independent semantic review.
|
|
42
42
|
- Runtime verification is separate from offline/CI verification.
|
|
43
43
|
- Projects consume versioned reusable workflows such as `@v1`; they do not copy the engine.
|
|
44
44
|
|
|
@@ -56,6 +56,8 @@ project tests/runtime rules
|
|
|
56
56
|
|
|
57
57
|
Its caller workflow will reference this repository's reusable workflow.
|
|
58
58
|
|
|
59
|
+
The framework does **not** install its own CI/check workflow into consumer repositories, does not configure required status checks, and does not modify branch protection. Existing consumer-repository build, test, lint, security, approval, and merge policies remain authoritative. The generated `.github/workflows/ai-workflow.yml` is orchestration only.
|
|
60
|
+
|
|
59
61
|
See:
|
|
60
62
|
- `AGENTS.md`
|
|
61
63
|
- `docs/lifecycle.md`
|
|
@@ -264,7 +266,7 @@ Local stdio MCP remains available with `--ado-mcp-mode local`. Supported MCP aut
|
|
|
264
266
|
|
|
265
267
|
## Worker registration
|
|
266
268
|
|
|
267
|
-
Setup can register local, Codespaces, or cloud workers separately from AI provider configuration.
|
|
269
|
+
Setup can register local, Codespaces, or cloud workers separately from AI provider configuration. Worker IDs are independent from credential identities, so multiple workers may share one credential reference.
|
|
268
270
|
|
|
269
271
|
Example local hybrid worker:
|
|
270
272
|
|
|
@@ -312,14 +314,28 @@ Use `./bin/ai-workflow update --check` to inspect the configured framework ref,
|
|
|
312
314
|
|
|
313
315
|
## Install from PyPI
|
|
314
316
|
|
|
315
|
-
|
|
317
|
+
Consumers do not need to clone this repository:
|
|
316
318
|
|
|
317
319
|
```bash
|
|
318
320
|
python -m pip install --upgrade ai-dev-workflow
|
|
319
|
-
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
After installation, start with the built-in guide:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
ai-workflow guide
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Typical first-run flow:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
cd /path/to/project
|
|
320
333
|
ai-workflow setup
|
|
334
|
+
ai-workflow doctor
|
|
321
335
|
```
|
|
322
336
|
|
|
337
|
+
The setup wizard detects the containing Git repository by default, shows the generated plan/configuration, and prints the next required steps after apply. Use `ai-workflow setup --help` for setup options and `ai-workflow guide` at any time for the end-to-end usage flow.
|
|
338
|
+
|
|
323
339
|
The GitHub repository may remain private because normal consumers install the built distribution from PyPI rather than cloning the source repository.
|
|
324
340
|
|
|
325
341
|
On another machine, install Python 3.10+ and run the same `pip install ai-dev-workflow` command. Project-specific configuration remains in each consumer repository.
|
|
@@ -332,3 +348,206 @@ ai-workflow update
|
|
|
332
348
|
```
|
|
333
349
|
|
|
334
350
|
The first command upgrades the installed CLI package. The second migrates/updates the workflow installation in the current project.
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
## PM and architecture planning
|
|
354
|
+
|
|
355
|
+
Product planning and technical architecture are separate roles:
|
|
356
|
+
|
|
357
|
+
```text
|
|
358
|
+
Idea / chat
|
|
359
|
+
→ PMAgent
|
|
360
|
+
→ product Keep/Split/Merge proposal
|
|
361
|
+
→ human approval
|
|
362
|
+
→ ArchitectAgent
|
|
363
|
+
→ technical Spec / ADR / decomposition
|
|
364
|
+
→ approval for structural architecture changes
|
|
365
|
+
→ Ready Freeze
|
|
366
|
+
→ TesterAgent
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
PMAgent owns what/why: intent, value, scope, priority, product acceptance boundaries, Epic/Issue classification and product-level decomposition. ArchitectAgent owns how: technical boundaries, interfaces, data model, Spec/ADR, technical dependencies and execution decomposition.
|
|
370
|
+
|
|
371
|
+
By default `workflow.planning.approval_policy` is `always`. Create, Split, Merge, Re-parent and Ready Freeze require explicit approval before provider mutation, and frozen contracts cannot be silently changed.
|
|
372
|
+
|
|
373
|
+
## Active work and claims
|
|
374
|
+
|
|
375
|
+
A selected task is not considered started until its worker/provider acknowledges it:
|
|
376
|
+
|
|
377
|
+
```text
|
|
378
|
+
ready/queued
|
|
379
|
+
-> reserved
|
|
380
|
+
-> offered
|
|
381
|
+
-> accepted by worker/provider
|
|
382
|
+
-> claim committed
|
|
383
|
+
-> active status
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Local agents acknowledge with the registered worker identity (for example through `ai-workflow claim`). Phase completion can be recorded with `ai-workflow complete-phase`, which releases the current claim and reserves an eligible worker for the next role. Automatic review always excludes the implementation worker_id; identity separation is enforced only when the optional strict-review policy is enabled.
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
## Azure DevOps configuration boundary
|
|
390
|
+
|
|
391
|
+
Azure DevOps project metadata and credentials are separate:
|
|
392
|
+
|
|
393
|
+
- project configuration owns organization/project, logical Epic/Issue Work Item Type mappings, and Area/Iteration defaults;
|
|
394
|
+
- worker configuration owns the Azure DevOps authentication strategy/credential reference;
|
|
395
|
+
- setup may borrow a worker credential temporarily to discover project metadata, but never persists the raw token;
|
|
396
|
+
- workers may share a credential reference when they intentionally act as the same ADO identity.
|
|
397
|
+
|
|
398
|
+
Area Path and Iteration Path options are discovered from the project's existing Azure DevOps classification nodes. Setup selects from existing values; it does not create or modify the project's classification hierarchy.
|
|
399
|
+
|
|
400
|
+
## Worker credentials and identity
|
|
401
|
+
|
|
402
|
+
Worker IDs and credentials are separate concepts. Several workers may intentionally use the same credential reference and therefore operate as the same GitHub/ADO actor. This is valid for normal planning, testing, implementation, and runtime work.
|
|
403
|
+
|
|
404
|
+
The workflow verifies effective actor identity where possible. A distinct credential is not required merely because workers are different. By default, ReviewerAgent only needs a different worker_id from the Implementer. Projects that require stronger separation may enable `reviewer.require_distinct_identity: true`.
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
## Local parallel workers
|
|
408
|
+
|
|
409
|
+
One local machine may register multiple workers that intentionally share the same GitHub/Azure DevOps credential sessions while using isolated working folders.
|
|
410
|
+
|
|
411
|
+
Example:
|
|
412
|
+
|
|
413
|
+
```yaml
|
|
414
|
+
workers:
|
|
415
|
+
- worker_id: codex-01
|
|
416
|
+
environment: local
|
|
417
|
+
provider: codex
|
|
418
|
+
workspace:
|
|
419
|
+
strategy: git-worktree
|
|
420
|
+
root: G:\ai-workers\codex-01
|
|
421
|
+
|
|
422
|
+
- worker_id: ccr-01
|
|
423
|
+
environment: local
|
|
424
|
+
provider: ccr
|
|
425
|
+
workspace:
|
|
426
|
+
strategy: git-worktree
|
|
427
|
+
root: G:\ai-workers\ccr-01
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Add another local worker after initial setup:
|
|
431
|
+
|
|
432
|
+
```powershell
|
|
433
|
+
ai-workflow add-worker
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
or non-interactively:
|
|
437
|
+
|
|
438
|
+
```powershell
|
|
439
|
+
ai-workflow add-worker `
|
|
440
|
+
--worker-id codex-02 `
|
|
441
|
+
--provider codex `
|
|
442
|
+
--mode hybrid `
|
|
443
|
+
--workspace G:\ai-workers\codex-02 `
|
|
444
|
+
--workspace-strategy git-worktree
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
By default the new local worker inherits credential references from an existing local worker. It still receives its own `worker_id` and isolated workspace. Use `--no-inherit-credentials` when the worker must use a different identity.
|
|
448
|
+
|
|
449
|
+
At runtime, a local worker is resolved in this order:
|
|
450
|
+
|
|
451
|
+
1. explicit `--worker <id>`;
|
|
452
|
+
2. `AI_WORKFLOW_WORKER_ID`;
|
|
453
|
+
3. current working directory contained by one configured `workspace.root`.
|
|
454
|
+
|
|
455
|
+
This makes it possible to open separate terminals in separate worker folders and run tasks concurrently without repeating the worker ID.
|
|
456
|
+
|
|
457
|
+
## Claude Code Router local provider
|
|
458
|
+
|
|
459
|
+
Claude Code Router can be registered as a local provider:
|
|
460
|
+
|
|
461
|
+
```yaml
|
|
462
|
+
providers:
|
|
463
|
+
ccr:
|
|
464
|
+
type: claude-code-router
|
|
465
|
+
base_url: http://127.0.0.1:3456
|
|
466
|
+
auth:
|
|
467
|
+
type: none
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
The gateway defaults to `http://127.0.0.1:3456`. A client-key environment reference can be configured when the local router is protected. Claude Code Router uses the same `CLAUDE.md` instruction adapter as Claude Code, while `AGENTS.md` remains the shared workflow instruction source.
|
|
471
|
+
|
|
472
|
+
A local CCR worker can then be registered with its own workspace:
|
|
473
|
+
|
|
474
|
+
```powershell
|
|
475
|
+
ai-workflow add-worker `
|
|
476
|
+
--worker-id ccr-01 `
|
|
477
|
+
--provider ccr `
|
|
478
|
+
--workspace G:\ai-workers\ccr-01
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
### Step-by-step add-worker wizard
|
|
483
|
+
|
|
484
|
+
Running `ai-workflow add-worker` with no `--non-interactive` flag now opens a structured wizard:
|
|
485
|
+
|
|
486
|
+
1. review existing project/provider configuration;
|
|
487
|
+
2. choose a worker id;
|
|
488
|
+
3. choose planner/executor/hybrid mode;
|
|
489
|
+
4. choose an existing AI provider;
|
|
490
|
+
5. choose roles;
|
|
491
|
+
6. choose the local workspace folder;
|
|
492
|
+
7. choose `git-worktree` or `folder` workspace strategy;
|
|
493
|
+
8. choose whether to inherit an existing local worker's credential references or configure separate GitHub/ADO references;
|
|
494
|
+
9. choose skills and capacity;
|
|
495
|
+
10. review the final worker configuration and confirm before saving.
|
|
496
|
+
|
|
497
|
+
The wizard never stores raw tokens. It only stores credential strategies/references already supported by the worker identity model.
|
|
498
|
+
|
|
499
|
+
For scripting/automation, keep the deterministic flag-based flow:
|
|
500
|
+
|
|
501
|
+
```powershell
|
|
502
|
+
ai-workflow add-worker `
|
|
503
|
+
--non-interactive `
|
|
504
|
+
--worker-id codex-02 `
|
|
505
|
+
--provider codex `
|
|
506
|
+
--mode hybrid `
|
|
507
|
+
--roles "ArchitectAgent|TesterAgent|ImplementerAgent|ReviewerAgent" `
|
|
508
|
+
--workspace G:\ai-workers\codex-02 `
|
|
509
|
+
--workspace-strategy git-worktree
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Use `--no-inherit-credentials` when the new worker must not reuse an existing local worker's credential references.
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
## Consumer worker registry and live presence
|
|
516
|
+
|
|
517
|
+
When a GitHub Issues or composite project has execution workers, setup writes:
|
|
518
|
+
|
|
519
|
+
```text
|
|
520
|
+
.github/ai-workflow-worker-registry.json
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
This committed registry contains routing metadata only:
|
|
524
|
+
|
|
525
|
+
- worker id;
|
|
526
|
+
- execution location;
|
|
527
|
+
- provider id;
|
|
528
|
+
- roles/capabilities;
|
|
529
|
+
- capacity;
|
|
530
|
+
- managed/unmanaged flag;
|
|
531
|
+
- GitHub assignee when required.
|
|
532
|
+
|
|
533
|
+
It intentionally excludes machine-local paths, machine ids, client launch commands, credential references, tokens, identities, heartbeat data, and active sessions.
|
|
534
|
+
|
|
535
|
+
For local execution workers, setup also creates or reuses one closed coordination Issue marked with:
|
|
536
|
+
|
|
537
|
+
```text
|
|
538
|
+
<!-- ai-dev-workflow:worker-presence -->
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
The Issue number is stored as project-level dispatcher metadata. Local workers publish the existing queue-dispatcher presence-v2 contract to that Issue using their own verified GitHub identity.
|
|
542
|
+
|
|
543
|
+
`ai-workflow worker open <worker-id>` keeps the local and central heartbeat alive while the configured Codex/Claude Code client process is running. When the client exits, the worker is reported offline.
|
|
544
|
+
|
|
545
|
+
For headless or daemon-style workers:
|
|
546
|
+
|
|
547
|
+
```powershell
|
|
548
|
+
ai-workflow worker serve <worker-id>
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
A worker keeps one presence comment and updates it on each heartbeat; it does not append a new comment every interval. The central dispatcher reads the consumer registry plus live presence before reserving work.
|
|
552
|
+
|
|
553
|
+
The consumer orchestration workflow remains `.github/workflows/ai-workflow.yml`. This integration does not install framework CI/check workflows, does not configure required status checks, and does not modify branch protection.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ai-dev-workflow"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "Provider-neutral AI-assisted development workflow and CLI"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -31,6 +31,10 @@ ai-workflow = "ai_workflow_cli:main"
|
|
|
31
31
|
package-dir = {"" = "tools"}
|
|
32
32
|
py-modules = [
|
|
33
33
|
"ado_mcp",
|
|
34
|
+
"workflow_handoff",
|
|
35
|
+
"workflow_runtime",
|
|
36
|
+
"work_claim",
|
|
37
|
+
"active_work_context",
|
|
34
38
|
"ado_provider",
|
|
35
39
|
"ai_provider",
|
|
36
40
|
"ai_workflow_cli",
|
|
@@ -39,11 +43,18 @@ py-modules = [
|
|
|
39
43
|
"github_work_item_provider",
|
|
40
44
|
"instruction_adapter",
|
|
41
45
|
"issue_publisher",
|
|
46
|
+
"planning_approval",
|
|
42
47
|
"planning_context",
|
|
43
48
|
"setup_context",
|
|
44
49
|
"setup_wizard",
|
|
45
50
|
"source_connection",
|
|
51
|
+
"skill_registry",
|
|
52
|
+
"work_breakdown",
|
|
46
53
|
"work_item_provider",
|
|
47
54
|
"work_item_registry",
|
|
55
|
+
"worker_identity",
|
|
56
|
+
"worker_presence",
|
|
48
57
|
"worker_registry",
|
|
58
|
+
"worker_runtime_manager",
|
|
59
|
+
"worker_session",
|
|
49
60
|
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import sys, unittest
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
|
4
|
+
|
|
5
|
+
from active_work_context import (
|
|
6
|
+
build_active_work_context, validate_context, role_for_phase,
|
|
7
|
+
queued_status_for_phase, active_status_for_phase,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Tests(unittest.TestCase):
|
|
12
|
+
def test_context_binds_worker_issue_phase_and_role(self):
|
|
13
|
+
worker={
|
|
14
|
+
"worker_id":"local-1","provider":"chatgpt","environment":"local",
|
|
15
|
+
"roles":["TesterAgent","ImplementerAgent"],
|
|
16
|
+
"identity":{"github":{"actor":"devuser"}},
|
|
17
|
+
}
|
|
18
|
+
ctx=build_active_work_context(
|
|
19
|
+
worker=worker,
|
|
20
|
+
phase="test-design",
|
|
21
|
+
github_issue={"repository":"o/r","number":85,"url":"https://example/85"},
|
|
22
|
+
ado_work_item={"id":1234},
|
|
23
|
+
epic={"id":1200},
|
|
24
|
+
session_id="session-1",
|
|
25
|
+
claim={"state":"reserved","dispatch_id":"d1"},
|
|
26
|
+
)
|
|
27
|
+
self.assertEqual(ctx["required_role"],"TesterAgent")
|
|
28
|
+
self.assertEqual(ctx["queued_status"],"ready")
|
|
29
|
+
self.assertEqual(ctx["active_status"],"in-progress")
|
|
30
|
+
self.assertEqual(ctx["ado_work_item"]["id"],1234)
|
|
31
|
+
self.assertEqual(validate_context(ctx),[])
|
|
32
|
+
|
|
33
|
+
def test_worker_must_support_phase_role(self):
|
|
34
|
+
with self.assertRaisesRegex(ValueError,"does not support"):
|
|
35
|
+
build_active_work_context(
|
|
36
|
+
worker={"worker_id":"w","roles":["ImplementerAgent"]},
|
|
37
|
+
phase="code-review",
|
|
38
|
+
github_issue={"repository":"o/r","number":1},
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
def test_phase_maps(self):
|
|
42
|
+
self.assertEqual(role_for_phase("implementing"),"ImplementerAgent")
|
|
43
|
+
self.assertEqual(queued_status_for_phase("code-review"),"in-review")
|
|
44
|
+
self.assertEqual(active_status_for_phase("runtime-verify"),"runtime-pending")
|
|
45
|
+
self.assertIsNone(role_for_phase("done"))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if __name__=="__main__": unittest.main()
|