opencode-swarm 6.9.0 → 6.11.0
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 +163 -4
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +7 -0
- package/dist/index.js +1898 -256
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/pre-check-batch.d.ts +54 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://img.shields.io/badge/version-6.
|
|
2
|
+
<img src="https://img.shields.io/badge/version-6.11.0-blue" alt="Version">
|
|
3
3
|
<img src="https://img.shields.io/badge/license-MIT-green" alt="License">
|
|
4
4
|
<img src="https://img.shields.io/badge/opencode-plugin-purple" alt="OpenCode Plugin">
|
|
5
5
|
<img src="https://img.shields.io/badge/agents-9-orange" alt="Agents">
|
|
@@ -108,8 +108,11 @@ OpenCode Swarm:
|
|
|
108
108
|
│ │
|
|
109
109
|
│ @coder (one task, full context) │
|
|
110
110
|
│ ↓ │
|
|
111
|
-
│ diff
|
|
112
|
-
│ (contract
|
|
111
|
+
│ diff → syntax_check → placeholder_scan → imports → lint fix │
|
|
112
|
+
│ (contract detection) (parse validation) (anti-slop) (AST-based) │
|
|
113
|
+
│ ↓ │
|
|
114
|
+
│ build_check → pre_check_batch (4 parallel: lint:check, secretscan, │
|
|
115
|
+
│ (compile verify) sast_scan, quality_budget) │
|
|
113
116
|
│ ↓ │
|
|
114
117
|
│ @reviewer (correctness pass) │
|
|
115
118
|
│ ↓ APPROVED │
|
|
@@ -119,9 +122,12 @@ OpenCode Swarm:
|
|
|
119
122
|
│ ↓ PASS │
|
|
120
123
|
│ @test_engineer (adversarial tests — boundary violations, injections) │
|
|
121
124
|
│ ↓ PASS │
|
|
125
|
+
│ ⛔ HARD STOP: Pre-commit checklist (4 items required, no override) │
|
|
126
|
+
│ ↓ COMPLETE │
|
|
122
127
|
│ plan.md → [x] Task complete │
|
|
123
128
|
│ │
|
|
124
|
-
│ Any gate fails →
|
|
129
|
+
│ Any gate fails → retry with failure count + structured rejection │
|
|
130
|
+
│ Max 5 retries → escalate to user │
|
|
125
131
|
└──────────────────────────────────────────────────────────────────────────┘
|
|
126
132
|
│
|
|
127
133
|
▼
|
|
@@ -497,6 +503,159 @@ Runs repo-native build/typecheck commands. Ensures code compiles before review.
|
|
|
497
503
|
### quality_budget - Maintainability Enforcement
|
|
498
504
|
Enforces complexity, API, duplication, and test-to-code ratio budgets. Configurable thresholds.
|
|
499
505
|
|
|
506
|
+
## Parallel Pre-Check Batch (v6.10.0)
|
|
507
|
+
|
|
508
|
+
### pre_check_batch - Parallel Verification
|
|
509
|
+
|
|
510
|
+
Runs four verification tools in parallel for faster QA gate execution:
|
|
511
|
+
- **lint:check** - Code quality verification (hard gate)
|
|
512
|
+
- **secretscan** - Secret detection (hard gate)
|
|
513
|
+
- **sast_scan** - Static security analysis (hard gate)
|
|
514
|
+
- **quality_budget** - Maintainability metrics
|
|
515
|
+
|
|
516
|
+
**Purpose**: Reduces total gate execution time from ~60s (sequential) to ~15s (parallel) by running independent checks concurrently.
|
|
517
|
+
|
|
518
|
+
**When to use**: After `build_check` passes and before `@reviewer` — all 4 gates must pass for `gates_passed: true`.
|
|
519
|
+
|
|
520
|
+
**Usage**:
|
|
521
|
+
```typescript
|
|
522
|
+
const result = await pre_check_batch({
|
|
523
|
+
directory: ".",
|
|
524
|
+
files: ["src/auth.ts", "src/session.ts"],
|
|
525
|
+
sast_threshold: "medium"
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
// Returns:
|
|
529
|
+
// {
|
|
530
|
+
// gates_passed: boolean, // All hard gates passed
|
|
531
|
+
// lint: { ran, result, error, duration_ms },
|
|
532
|
+
// secretscan: { ran, result, error, duration_ms },
|
|
533
|
+
// sast_scan: { ran, result, error, duration_ms },
|
|
534
|
+
// quality_budget: { ran, result, error, duration_ms },
|
|
535
|
+
// total_duration_ms: number
|
|
536
|
+
// }
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
**Hard Gates** (must pass for gates_passed=true):
|
|
540
|
+
- Lint errors → Fix and retry
|
|
541
|
+
- Secrets found → Fix and retry
|
|
542
|
+
- SAST vulnerabilities at/above threshold → Fix and retry
|
|
543
|
+
- Quality budget violations → Refactor or adjust thresholds
|
|
544
|
+
|
|
545
|
+
**Parallel Execution Safety**:
|
|
546
|
+
- Max 4 concurrent operations via `p-limit`
|
|
547
|
+
- 60-second timeout per tool
|
|
548
|
+
- 500KB output size limit
|
|
549
|
+
- Individual tool failures don't cascade to others
|
|
550
|
+
|
|
551
|
+
### Configuration
|
|
552
|
+
|
|
553
|
+
Enable/disable parallel pre-check via `.opencode/swarm.json`:
|
|
554
|
+
|
|
555
|
+
```json
|
|
556
|
+
{
|
|
557
|
+
"pipeline": {
|
|
558
|
+
"parallel_precheck": true // default: true
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
Set to `false` to run gates sequentially (useful for debugging or resource-constrained environments).
|
|
564
|
+
|
|
565
|
+
### Updated Phase 5 QA Sequence (v6.11.0)
|
|
566
|
+
|
|
567
|
+
Complete execution pipeline with MODE labels and observable outputs:
|
|
568
|
+
|
|
569
|
+
```
|
|
570
|
+
MODE: EXECUTE (per task)
|
|
571
|
+
│
|
|
572
|
+
├── 5a. @coder implements (ONE task only)
|
|
573
|
+
│ └── → REQUIRED: Print task start confirmation
|
|
574
|
+
│
|
|
575
|
+
├── 5b. diff + imports tools (contract + dependency analysis)
|
|
576
|
+
│ └── → REQUIRED: Print change summary
|
|
577
|
+
│
|
|
578
|
+
├── 5c. syntax_check (parse validation)
|
|
579
|
+
│ └── → REQUIRED: Print syntax status
|
|
580
|
+
│
|
|
581
|
+
├── 5d. placeholder_scan (anti-slop detection)
|
|
582
|
+
│ └── → REQUIRED: Print placeholder scan results
|
|
583
|
+
│
|
|
584
|
+
├── 5e. lint fix → 5f. lint:check (inside pre_check_batch)
|
|
585
|
+
│ └── → REQUIRED: Print lint status
|
|
586
|
+
│
|
|
587
|
+
├── 5g. build_check (compilation verification)
|
|
588
|
+
│ └── → REQUIRED: Print build status
|
|
589
|
+
│
|
|
590
|
+
├── 5h. pre_check_batch (4 parallel gates)
|
|
591
|
+
│ ├── lint:check (hard gate)
|
|
592
|
+
│ ├── secretscan (hard gate)
|
|
593
|
+
│ ├── sast_scan (hard gate)
|
|
594
|
+
│ └── quality_budget (maintainability metrics)
|
|
595
|
+
│ └── → REQUIRED: Print gates_passed status
|
|
596
|
+
│
|
|
597
|
+
├── 5i. @reviewer (correctness pass)
|
|
598
|
+
│ └── → REQUIRED: Print approval decision
|
|
599
|
+
│
|
|
600
|
+
├── 5j. @reviewer security-only pass (if security file)
|
|
601
|
+
│ └── → REQUIRED: Print security approval
|
|
602
|
+
│
|
|
603
|
+
├── 5k. @test_engineer (verification tests + coverage)
|
|
604
|
+
│ └── → REQUIRED: Print test results
|
|
605
|
+
│
|
|
606
|
+
├── 5l. @test_engineer (adversarial tests)
|
|
607
|
+
│ └── → REQUIRED: Print adversarial test results
|
|
608
|
+
│
|
|
609
|
+
├── 5m. ⛔ HARD STOP: Pre-commit checklist
|
|
610
|
+
│ ├── [ ] All QA gates passed (no overrides)
|
|
611
|
+
│ ├── [ ] Reviewer approval documented
|
|
612
|
+
│ ├── [ ] Tests pass with evidence
|
|
613
|
+
│ └── [ ] No security findings
|
|
614
|
+
│ └── → REQUIRED: Print checklist completion
|
|
615
|
+
│
|
|
616
|
+
└── 5n. TASK COMPLETION CHECKLIST (emit before marking complete)
|
|
617
|
+
├── Evidence written to .swarm/evidence/{taskId}/
|
|
618
|
+
├── plan.md updated with [x] task complete
|
|
619
|
+
└── → REQUIRED: Print completion confirmation
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
**MODE Labels** (v6.11): Architect workflow uses MODE labels internally:
|
|
623
|
+
- `MODE: RESUME` — Resume detection
|
|
624
|
+
- `MODE: CLARIFY` — Requirement clarification
|
|
625
|
+
- `MODE: DISCOVER` — Codebase exploration
|
|
626
|
+
- `MODE: CONSULT` — SME consultation
|
|
627
|
+
- `MODE: PLAN` — Plan creation
|
|
628
|
+
- `MODE: CRITIC-GATE` — Plan review checkpoint
|
|
629
|
+
- `MODE: EXECUTE` — Task implementation
|
|
630
|
+
- `MODE: PHASE-WRAP` — Phase completion
|
|
631
|
+
|
|
632
|
+
**NAMESPACE RULE**: MODE labels refer to architect workflow phases. Project plan phases (in plan.md) remain as "Phase N".
|
|
633
|
+
|
|
634
|
+
**Retry Protocol** (v6.11): On failure, emit structured rejection:
|
|
635
|
+
```
|
|
636
|
+
RETRY #{count}/5
|
|
637
|
+
FAILED GATE: {gate_name}
|
|
638
|
+
REASON: {specific failure}
|
|
639
|
+
REQUIRED FIX: {actionable instruction}
|
|
640
|
+
RESUME AT: {step_5x}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
**Anti-Exemption Rules** (v6.11): The following rationalizations are explicitly blocked:
|
|
644
|
+
- "It's a simple change"
|
|
645
|
+
- "Just updating docs"
|
|
646
|
+
- "Only a config tweak"
|
|
647
|
+
- "Hotfix, no time for QA"
|
|
648
|
+
- "The tests pass locally"
|
|
649
|
+
- "I'll clean it up later"
|
|
650
|
+
- "No logic changes"
|
|
651
|
+
- "Already reviewed the pattern"
|
|
652
|
+
|
|
653
|
+
**Pre-Commit Rule** (v6.11): All 4 checkboxes required before commit. No override. A commit without completed QA gate is a workflow violation.
|
|
654
|
+
|
|
655
|
+
### Rollback
|
|
656
|
+
|
|
657
|
+
If parallel execution causes issues, refer to `.swarm/ROLLBACK-pre-check-batch.md` for rollback instructions.
|
|
658
|
+
|
|
500
659
|
### Local-Only Guarantee
|
|
501
660
|
All v6.9.0 quality tools run locally without:
|
|
502
661
|
- Docker containers
|
package/dist/config/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export { ApprovalEvidenceSchema, BaseEvidenceSchema, DiffEvidenceSchema, EVIDENC
|
|
|
5
5
|
export { loadAgentPrompt, loadPluginConfig, loadPluginConfigWithMeta, } from './loader';
|
|
6
6
|
export type { MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskStatus, } from './plan-schema';
|
|
7
7
|
export { MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
|
|
8
|
-
export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, PluginConfig, SwarmConfig, } from './schema';
|
|
9
|
-
export { AgentOverrideConfigSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, PluginConfigSchema, SwarmConfigSchema, } from './schema';
|
|
8
|
+
export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, PipelineConfig, PluginConfig, SwarmConfig, } from './schema';
|
|
9
|
+
export { AgentOverrideConfigSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, PipelineConfigSchema, PluginConfigSchema, SwarmConfigSchema, } from './schema';
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -171,6 +171,10 @@ export declare const GateConfigSchema: z.ZodObject<{
|
|
|
171
171
|
}, z.core.$strip>;
|
|
172
172
|
}, z.core.$strip>;
|
|
173
173
|
export type GateConfig = z.infer<typeof GateConfigSchema>;
|
|
174
|
+
export declare const PipelineConfigSchema: z.ZodObject<{
|
|
175
|
+
parallel_precheck: z.ZodDefault<z.ZodBoolean>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export type PipelineConfig = z.infer<typeof PipelineConfigSchema>;
|
|
174
178
|
export declare const SummaryConfigSchema: z.ZodObject<{
|
|
175
179
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
176
180
|
threshold_bytes: z.ZodDefault<z.ZodNumber>;
|
|
@@ -343,6 +347,9 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
343
347
|
}, z.core.$strip>>>;
|
|
344
348
|
}, z.core.$strip>>>;
|
|
345
349
|
max_iterations: z.ZodDefault<z.ZodNumber>;
|
|
350
|
+
pipeline: z.ZodOptional<z.ZodObject<{
|
|
351
|
+
parallel_precheck: z.ZodDefault<z.ZodBoolean>;
|
|
352
|
+
}, z.core.$strip>>;
|
|
346
353
|
qa_retry_limit: z.ZodDefault<z.ZodNumber>;
|
|
347
354
|
inject_phase_reminders: z.ZodDefault<z.ZodBoolean>;
|
|
348
355
|
hooks: z.ZodOptional<z.ZodObject<{
|