opencode-swarm 6.67.1 → 6.68.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/dist/state.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  * and delegation chains.
8
8
  */
9
9
  import type { OpencodeClient } from '@opencode-ai/sdk';
10
+ import type { QaGates } from './db/qa-gate-profile.js';
10
11
  import { type EnvironmentProfile } from './environment/profile.js';
11
12
  /**
12
13
  * Represents a single tool call entry for tracking purposes
@@ -133,6 +134,12 @@ export interface AgentSessionState {
133
134
  modelFallbackExhausted: boolean;
134
135
  /** Session-scoped Turbo Mode flag for controlling LLM inference speed */
135
136
  turboMode: boolean;
137
+ /** Session-level QA gate overrides layered on top of the spec-level profile.
138
+ * Overrides can only enable gates (true); false values are ignored by
139
+ * getEffectiveGates. Cleared on session reset. Optional for backwards
140
+ * compatibility with pre-existing session state fixtures; consumers
141
+ * should read via `session.qaGateSessionOverrides ?? {}`. */
142
+ qaGateSessionOverrides?: Partial<QaGates>;
136
143
  /** Session-scoped Full Auto flag for autonomous multi-agent oversight */
137
144
  fullAutoMode: boolean;
138
145
  /** Count of full-auto interactions this phase (for max_interactions_per_phase limit) */
@@ -22,6 +22,10 @@ interface GetApprovedPlanResult {
22
22
  current_plan?: CurrentPlanPayload | null;
23
23
  drift_detected?: boolean | 'unknown';
24
24
  current_plan_error?: string;
25
+ /** SHA-256 hex digest over {plan_id, gates} of the current QA gate profile,
26
+ * or null when no profile exists for this plan. Used by the critic to
27
+ * detect silent gate mutations post-approval. */
28
+ qa_profile_hash?: string | null;
25
29
  }
26
30
  interface ApprovedPlanPayload {
27
31
  plan: unknown;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Tool to retrieve the QA gate profile for the current plan.
3
+ *
4
+ * Read-only: derives plan_id from plan.json, then looks up the profile in the
5
+ * per-project DB. Returns the spec-level profile gates, lock state, and profile
6
+ * hash. Callers layering session overrides should combine with
7
+ * `getEffectiveGates` themselves — this tool intentionally returns the
8
+ * persisted/locked spec-level view.
9
+ */
10
+ import type { tool } from '@opencode-ai/plugin';
11
+ interface GetQaGateProfileResult {
12
+ success: boolean;
13
+ reason?: string;
14
+ plan_id?: string;
15
+ profile?: {
16
+ plan_id: string;
17
+ project_type: string | null;
18
+ gates: Record<string, boolean>;
19
+ locked_at: string | null;
20
+ locked_by_snapshot_seq: number | null;
21
+ created_at: string;
22
+ profile_hash: string;
23
+ };
24
+ }
25
+ export declare function executeGetQaGateProfile(_args: Record<string, unknown>, directory: string): Promise<GetQaGateProfileResult>;
26
+ export declare const get_qa_gate_profile: ReturnType<typeof tool>;
27
+ export {};
@@ -15,6 +15,7 @@ export { detect_domains } from './domain-detector';
15
15
  export { evidence_check } from './evidence-check';
16
16
  export { extract_code_blocks } from './file-extractor';
17
17
  export { get_approved_plan } from './get-approved-plan';
18
+ export { get_qa_gate_profile } from './get-qa-gate-profile';
18
19
  export { fetchGitingest, type GitingestArgs, gitingest } from './gitingest';
19
20
  export { imports } from './imports';
20
21
  export { knowledge_add } from './knowledge-add';
@@ -38,6 +39,7 @@ export { type SbomGenerateInput, type SbomGenerateResult, sbom_generate, } from
38
39
  export { schema_drift } from './schema-drift';
39
40
  export { search } from './search';
40
41
  export { type SecretFinding, type SecretscanResult, secretscan, } from './secretscan';
42
+ export { set_qa_gates } from './set-qa-gates';
41
43
  import { suggestPatch } from './suggest-patch';
42
44
  export { suggestPatch };
43
45
  export type { SuggestPatchArgs } from './suggest-patch';
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Tool to configure the QA gate profile for the current plan.
3
+ *
4
+ * Architect-only: invoked during the QA GATE SELECTION phase of brainstorm
5
+ * mode (or equivalent). Ratchet-tighter only — cannot disable gates that are
6
+ * already enabled. Rejects all writes once the profile is locked.
7
+ *
8
+ * Creates the profile with defaults if missing, then applies the requested
9
+ * partial update.
10
+ */
11
+ import { tool } from '@opencode-ai/plugin';
12
+ export interface SetQaGatesArgs {
13
+ reviewer?: boolean;
14
+ test_engineer?: boolean;
15
+ council_mode?: boolean;
16
+ sme_enabled?: boolean;
17
+ critic_pre_plan?: boolean;
18
+ hallucination_guard?: boolean;
19
+ sast_enabled?: boolean;
20
+ project_type?: string;
21
+ }
22
+ interface SetQaGatesResult {
23
+ success: boolean;
24
+ reason?: string;
25
+ message?: string;
26
+ plan_id?: string;
27
+ profile?: {
28
+ plan_id: string;
29
+ gates: Record<string, boolean>;
30
+ locked_at: string | null;
31
+ locked_by_snapshot_seq: number | null;
32
+ profile_hash: string;
33
+ };
34
+ }
35
+ export declare function executeSetQaGates(args: SetQaGatesArgs, directory: string): Promise<SetQaGatesResult>;
36
+ export declare const set_qa_gates: ReturnType<typeof tool>;
37
+ export {};
@@ -3,7 +3,7 @@
3
3
  * Used for constants and agent setup references.
4
4
  */
5
5
  /** Union type of all valid tool names */
6
- export type ToolName = 'diff' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'completion_verify' | 'convene_council' | 'declare_council_criteria' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'lint_spec' | 'write_retro' | 'write_drift_evidence' | 'declare_scope' | 'knowledge_query' | 'doc_scan' | 'doc_extract' | 'curator_analyze' | 'knowledge_add' | 'knowledge_recall' | 'knowledge_remove' | 'co_change_analyzer' | 'search' | 'batch_symbols' | 'suggest_patch' | 'req_coverage' | 'get_approved_plan' | 'repo_map';
6
+ export type ToolName = 'diff' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'completion_verify' | 'convene_council' | 'declare_council_criteria' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'lint_spec' | 'write_retro' | 'write_drift_evidence' | 'declare_scope' | 'knowledge_query' | 'doc_scan' | 'doc_extract' | 'curator_analyze' | 'knowledge_add' | 'knowledge_recall' | 'knowledge_remove' | 'co_change_analyzer' | 'search' | 'batch_symbols' | 'suggest_patch' | 'req_coverage' | 'get_approved_plan' | 'repo_map' | 'get_qa_gate_profile' | 'set_qa_gates';
7
7
  /** Readonly array of all tool names */
8
8
  export declare const TOOL_NAMES: readonly ToolName[];
9
9
  /** Set for O(1) tool name validation */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.67.1",
3
+ "version": "6.68.0",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",