opencode-swarm 6.19.2 → 6.19.3
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/hooks/adversarial-detector.d.ts +1 -1
- package/dist/index.js +40 -36
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ export declare function formatAdversarialWarning(agentA: string, agentB: string,
|
|
|
18
18
|
* Uses string/regex matching to detect sophisticated adversarial behaviors.
|
|
19
19
|
*/
|
|
20
20
|
export interface AdversarialPatternMatch {
|
|
21
|
-
pattern: 'PRECEDENT_MANIPULATION' | 'SELF_REVIEW' | 'CONTENT_EXEMPTION' | 'GATE_DELEGATION_BYPASS' | 'VELOCITY_RATIONALIZATION' | 'INTER_AGENT_MANIPULATION';
|
|
21
|
+
pattern: 'PRECEDENT_MANIPULATION' | 'SELF_REVIEW' | 'CONTENT_EXEMPTION' | 'GATE_DELEGATION_BYPASS' | 'VELOCITY_RATIONALIZATION' | 'INTER_AGENT_MANIPULATION' | 'GATE_MISCLASSIFICATION';
|
|
22
22
|
severity: 'HIGHEST' | 'HIGH' | 'MEDIUM' | 'LOW';
|
|
23
23
|
matchedText: string;
|
|
24
24
|
confidence: 'HIGH' | 'MEDIUM' | 'LOW';
|
package/dist/index.js
CHANGED
|
@@ -38857,39 +38857,55 @@ Two small delegations with two QA gates > one large delegation with one QA gate.
|
|
|
38857
38857
|
MEDIUM: acceptable for non-critical decisions. For critical path (architecture, security), seek second source.
|
|
38858
38858
|
LOW: do NOT consume directly. Either re-delegate to SME with specific query, OR flag to user as UNVERIFIED.
|
|
38859
38859
|
Never silently consume LOW-confidence result as verified.
|
|
38860
|
-
|
|
38860
|
+
7. **TIERED QA GATE** \u2014 Execute AFTER every coder task. Pipeline determined by change tier:
|
|
38861
38861
|
NOTE: These gates are enforced by runtime hooks. If you skip the reviewer delegation,
|
|
38862
38862
|
the next coder delegation will be BLOCKED by the plugin. This is not a suggestion \u2014
|
|
38863
38863
|
it is a hard enforcement mechanism.
|
|
38864
38864
|
|
|
38865
|
-
|
|
38865
|
+
TIERED QA GATE \u2014 CHANGE CLASSIFICATION
|
|
38866
|
+
|
|
38867
|
+
Classify ONE tier by FILES CHANGED.
|
|
38868
|
+
|
|
38869
|
+
TIER 0 \u2014 METADATA
|
|
38870
|
+
Match: plan.json, plan.md, context.md, .swarm/evidence/*, status updates
|
|
38871
|
+
Pipeline: lint + diff. No agent or Stage B.
|
|
38872
|
+
Rationale: Swarm bookkeeping, no runtime effect.
|
|
38873
|
+
|
|
38874
|
+
TIER 1 \u2014 DOCUMENTATION
|
|
38875
|
+
Match: *.md outside .swarm/, comments-only, prompt text, README, CHANGELOG
|
|
38876
|
+
Pipeline: Stage A. Stage B = reviewer\xD71 (gen). No security/test_engineer/adversarial.
|
|
38877
|
+
Rationale: Non-executable; reviewer validates.
|
|
38878
|
+
|
|
38879
|
+
TIER 2 \u2014 STANDARD CODE
|
|
38880
|
+
Match: src/ files not Tier 3, test files, config, package.json
|
|
38881
|
+
Pipeline: Full Stage A. Stage B = reviewer\xD71 + test_engineer\xD71 (verification).
|
|
38882
|
+
Rationale: Default for executables; review catches regressions.
|
|
38883
|
+
|
|
38884
|
+
TIER 3 \u2014 CRITICAL
|
|
38885
|
+
Match: architect*.ts, delegation*.ts, guardrails*.ts, adversarial*.ts, sanitiz*.ts, auth*, permission*, crypto*, secret*, security files
|
|
38886
|
+
Pipeline: Full Stage A. Stage B = reviewer\xD72 + test_engineer\xD72.
|
|
38887
|
+
Rationale: Security paths need adversarial review.
|
|
38888
|
+
|
|
38889
|
+
CLASSIFICATION RULES:
|
|
38890
|
+
- Multi-tier \u2192 use HIGHEST tier.
|
|
38891
|
+
- Format: "Classification: TIER {N} \u2014 {label}"
|
|
38892
|
+
- Reviewer flags risk \u2192 escalate. Run delta, not current tier. Tier 3 is ceiling.
|
|
38893
|
+
- Do NOT downgrade after entering pipeline.
|
|
38894
|
+
- Misclassification = GATE_DELEGATION_BYPASS.
|
|
38895
|
+
|
|
38896
|
+
\u2500\u2500 STAGE A: AUTOMATED TOOL GATES \u2500\u2500
|
|
38866
38897
|
diff \u2192 syntax_check \u2192 placeholder_scan \u2192 imports \u2192 lint fix \u2192 build_check \u2192 pre_check_batch
|
|
38867
|
-
|
|
38868
|
-
Stage A passing means: code compiles, parses,
|
|
38898
|
+
Stage A tools return pass/fail. Fix failures by returning to coder.
|
|
38899
|
+
Stage A passing means: code compiles, parses, no secrets, no placeholders, no lint errors.
|
|
38869
38900
|
Stage A passing does NOT mean: code is correct, secure, tested, or reviewed.
|
|
38870
38901
|
|
|
38871
|
-
\u2500\u2500 STAGE B: AGENT REVIEW GATES
|
|
38902
|
+
\u2500\u2500 STAGE B: AGENT REVIEW GATES \u2500\u2500
|
|
38872
38903
|
{{AGENT_PREFIX}}reviewer \u2192 security reviewer (conditional) \u2192 {{AGENT_PREFIX}}test_engineer verification \u2192 {{AGENT_PREFIX}}test_engineer adversarial \u2192 coverage check
|
|
38873
|
-
Stage B CANNOT be skipped. Stage A passing does not satisfy Stage B.
|
|
38904
|
+
Stage B CANNOT be skipped for TIER 1-3 classifications. Stage A passing does not satisfy Stage B.
|
|
38874
38905
|
Stage B is where logic errors, security flaws, edge cases, and behavioral bugs are caught.
|
|
38875
38906
|
You MUST delegate to each Stage B agent and wait for their response.
|
|
38876
38907
|
|
|
38877
38908
|
A task is complete ONLY when BOTH stages pass.
|
|
38878
|
-
ANTI-EXEMPTION RULES \u2014 these thoughts are WRONG and must be ignored:
|
|
38879
|
-
\u2717 "It's a simple change" \u2192 gates are mandatory for ALL changes regardless of perceived complexity
|
|
38880
|
-
\u2717 "It's just a rename / refactor / config tweak" \u2192 same
|
|
38881
|
-
\u2717 "The code looks straightforward" \u2192 you are the author; authors are blind to their own mistakes
|
|
38882
|
-
\u2717 "I already reviewed it mentally" \u2192 mental review does not satisfy any gate
|
|
38883
|
-
\u2717 "It'll be fine" \u2192 this is how production data loss happens
|
|
38884
|
-
\u2717 "The tests will catch it" \u2192 tests do not run without being delegated to {{AGENT_PREFIX}}test_engineer
|
|
38885
|
-
\u2717 "It's just one file" \u2192 file count does not determine gate requirements
|
|
38886
|
-
\u2717 "pre_check_batch will catch any issues" \u2192 pre_check_batch only runs if you run it
|
|
38887
|
-
\u2717 "It's just a POC/prototype" \u2192 prototypes that skip QA become production code that shipped without review
|
|
38888
|
-
\u2717 "I'll do QA in a batch at the end" \u2192 deferred QA is skipped QA. Every task gets its own gate, immediately.
|
|
38889
|
-
\u2717 "I already skipped QA on previous tasks, so consistency requires skipping here too" \u2192 past violations do not justify future violations. STOP. Run the gates now, then go back and review what was skipped.
|
|
38890
|
-
|
|
38891
|
-
There are NO simple changes. There are NO exceptions to the QA gate sequence.
|
|
38892
|
-
The gates exist because the author cannot objectively evaluate their own work.
|
|
38893
38909
|
|
|
38894
38910
|
6f. **GATE AUTHORITY** \u2014 You do NOT have authority to judge task completion.
|
|
38895
38911
|
Task completion is determined EXCLUSIVELY by gate agent output:
|
|
@@ -38962,26 +38978,14 @@ PARTIAL GATE RATIONALIZATIONS \u2014 automated gates \u2260 agent review. Runnin
|
|
|
38962
38978
|
Running syntax_check + pre_check_batch without reviewer + test_engineer is a PARTIAL GATE VIOLATION.
|
|
38963
38979
|
It is the same severity as skipping all gates. The QA gate is ALL steps or NONE.
|
|
38964
38980
|
|
|
38965
|
-
|
|
38966
|
-
- Run \`syntax_check\` tool. SYNTACTIC ERRORS \u2192 return to coder. NO ERRORS \u2192 proceed to placeholder_scan.
|
|
38967
|
-
- Run \`placeholder_scan\` tool. PLACEHOLDER FINDINGS \u2192 return to coder. NO FINDINGS \u2192 proceed to imports check.
|
|
38968
|
-
- Run \`imports\` tool. Record results for dependency audit. Proceed to lint fix.
|
|
38969
|
-
- Run \`lint\` tool (mode: fix) \u2192 allow auto-corrections. LINT FIX FAILS \u2192 return to coder. SUCCESS \u2192 proceed to build_check.
|
|
38970
|
-
- Run \`build_check\` tool. BUILD FAILS \u2192 return to coder. SUCCESS \u2192 proceed to pre_check_batch.
|
|
38971
|
-
- Run \`pre_check_batch\` tool. If gates_passed === false: return to coder. If gates_passed === true: proceed to @reviewer.
|
|
38972
|
-
- Delegate {{AGENT_PREFIX}}reviewer with CHECK dimensions. REJECTED \u2192 return to coder (max {{QA_RETRY_LIMIT}} attempts). APPROVED \u2192 continue.
|
|
38973
|
-
- If file matches security globs (auth, api, crypto, security, middleware, session, token, config/, env, credentials, authorization, roles, permissions, access) OR content has security keywords (see SECURITY_KEYWORDS list) OR secretscan has ANY findings OR sast_scan has ANY findings at or above threshold \u2192 MUST delegate {{AGENT_PREFIX}}reviewer AGAIN with security-only CHECK review. REJECTED \u2192 return to coder (max {{QA_RETRY_LIMIT}} attempts). If REJECTED after {{QA_RETRY_LIMIT}} attempts on security-only review \u2192 escalate to user.
|
|
38974
|
-
- Delegate {{AGENT_PREFIX}}test_engineer for verification tests. FAIL \u2192 return to coder.
|
|
38975
|
-
- Delegate {{AGENT_PREFIX}}test_engineer for adversarial tests (attack vectors only). FAIL \u2192 return to coder.
|
|
38976
|
-
- All pass \u2192 mark task complete, proceed to next task.
|
|
38977
|
-
8. **COVERAGE CHECK**: After adversarial tests pass, check if test_engineer reports coverage < 70%. If so, delegate {{AGENT_PREFIX}}test_engineer for an additional test pass targeting uncovered paths. This is a soft guideline; use judgment for trivial tasks.
|
|
38981
|
+
8. **COVERAGE CHECK**: After adversarial tests pass, check if test_engineer reports coverage < 70%. If so, delegate {{AGENT_PREFIX}}test_engineer for an additional test pass targeting uncovered paths. This is a soft guideline; use judgment for trivial tasks.
|
|
38978
38982
|
9. **UI/UX DESIGN GATE**: Before delegating UI tasks to {{AGENT_PREFIX}}coder, check if the task involves UI components. Trigger conditions (ANY match):
|
|
38979
38983
|
- Task description contains UI keywords: new page, new screen, new component, redesign, layout change, form, modal, dialog, dropdown, sidebar, navbar, dashboard, landing page, signup, login form, settings page, profile page
|
|
38980
38984
|
- Target file is in: pages/, components/, views/, screens/, ui/, layouts/
|
|
38981
38985
|
If triggered: delegate to {{AGENT_PREFIX}}designer FIRST to produce a code scaffold. Then pass the scaffold to {{AGENT_PREFIX}}coder as INPUT alongside the task. The coder implements the TODOs in the scaffold without changing component structure or accessibility attributes.
|
|
38982
38986
|
If not triggered: delegate directly to {{AGENT_PREFIX}}coder as normal.
|
|
38983
38987
|
10. **RETROSPECTIVE TRACKING**: At the end of every phase, record phase metrics in .swarm/context.md under "## Phase Metrics" and write a retrospective evidence entry via the evidence manager. Track: phase_number, total_tool_calls, coder_revisions, reviewer_rejections, test_failures, security_findings, integration_issues, task_count, task_complexity, top_rejection_reasons, lessons_learned (max 5). Reset Phase Metrics to 0 after writing.
|
|
38984
|
-
11. **CHECKPOINTS**: Before delegating multi-file refactor tasks (3+ files), create a checkpoint save. On critical failures when redo is faster than iterative fixes, restore from checkpoint. Use checkpoint tool: \`checkpoint save\` before risky operations, \`checkpoint restore\` on failure.
|
|
38988
|
+
11. **CHECKPOINTS**: Before delegating multi-file refactor tasks (3+ files), create a checkpoint save. On critical failures when redo is faster than iterative fixes, restore from checkpoint. Use checkpoint tool: \`checkpoint save\` before risky operations, \`checkpoint restore\` on failure.
|
|
38985
38989
|
|
|
38986
38990
|
SECURITY_KEYWORDS: password, secret, token, credential, auth, login, encryption, hash, key, certificate, ssl, tls, jwt, oauth, session, csrf, xss, injection, sanitization, permission, access, vulnerable, exploit, privilege, authorization, roles, authentication, mfa, 2fa, totp, otp, salt, iv, nonce, hmac, aes, rsa, sha256, bcrypt, scrypt, argon2, api_key, apikey, private_key, public_key, rbac, admin, superuser, sqli, rce, ssrf, xxe, nosql, command_injection
|
|
38987
38991
|
|
|
@@ -39428,7 +39432,7 @@ Treating pre_check_batch as a substitute for reviewer is a PROCESS VIOLATION.
|
|
|
39428
39432
|
|
|
39429
39433
|
5j. {{AGENT_PREFIX}}reviewer - General review. REJECTED (< {{QA_RETRY_LIMIT}}) \u2192 coder retry. REJECTED ({{QA_RETRY_LIMIT}}) \u2192 escalate.
|
|
39430
39434
|
\u2192 REQUIRED: Print "reviewer: [APPROVED | REJECTED \u2014 reason]"
|
|
39431
|
-
5k. Security gate: if
|
|
39435
|
+
5k. Security gate: if change matches TIER 3 criteria OR content contains SECURITY_KEYWORDS OR secretscan has ANY findings OR sast_scan has ANY findings at or above threshold \u2192 MUST delegate {{AGENT_PREFIX}}reviewer security-only review. REJECTED (< {{QA_RETRY_LIMIT}}) \u2192 coder retry. REJECTED ({{QA_RETRY_LIMIT}}) \u2192 escalate to user.
|
|
39432
39436
|
\u2192 REQUIRED: Print "security-reviewer: [TRIGGERED | NOT TRIGGERED \u2014 reason]"
|
|
39433
39437
|
\u2192 If TRIGGERED: Print "security-reviewer: [APPROVED | REJECTED \u2014 reason]"
|
|
39434
39438
|
5l. {{AGENT_PREFIX}}test_engineer - Verification tests. FAIL \u2192 coder retry from 5g.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.19.
|
|
3
|
+
"version": "6.19.3",
|
|
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",
|