opencode-swarm 7.135.3 → 7.135.4

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.
Files changed (40) hide show
  1. package/dist/agents/explorer.d.ts +1 -1
  2. package/dist/cli/{config-doctor-4nznqeca.js → config-doctor-fgmemknc.js} +2 -2
  3. package/dist/cli/{curation-policy-81m14519.js → curation-policy-frs28q57.js} +2 -2
  4. package/dist/cli/{curator-llm-factory-fem13y9n.js → curator-llm-factory-pr59p535.js} +13 -13
  5. package/dist/cli/{curator-e0z5gcww.js → curator-psq8m2j7.js} +13 -13
  6. package/dist/cli/{explorer-15gqzxh8.js → explorer-swjc297z.js} +1 -1
  7. package/dist/cli/{guardrail-explain-wgaj23hd.js → guardrail-explain-ws45zchy.js} +14 -14
  8. package/dist/cli/{guardrail-log-04p1z1vt.js → guardrail-log-gbzek1pz.js} +3 -3
  9. package/dist/cli/{hive-promoter-k345z42k.js → hive-promoter-gdbg4nyd.js} +13 -13
  10. package/dist/cli/{index-bcmrg4t4.js → index-4g3nq4sh.js} +1 -1
  11. package/dist/cli/{index-p9ngg568.js → index-5s1q6xcw.js} +4 -4
  12. package/dist/cli/{index-dwargd10.js → index-66w4jjg6.js} +54 -42
  13. package/dist/cli/{index-dg1njnms.js → index-6mjf4vr1.js} +1 -1
  14. package/dist/cli/{index-wygxzvtf.js → index-ajehqzvn.js} +1 -1
  15. package/dist/cli/{index-kb7qy7an.js → index-b34vbxmx.js} +1 -1
  16. package/dist/cli/{index-p5kr35wh.js → index-cg413zhk.js} +1 -1
  17. package/dist/cli/{index-5436jxnw.js → index-cgqekdja.js} +2 -2
  18. package/dist/cli/{index-a01r818w.js → index-ck9rx6j1.js} +1 -1
  19. package/dist/cli/{index-gxxxmajn.js → index-fx7bn93y.js} +2 -2
  20. package/dist/cli/{index-yf30m841.js → index-g86vfxnk.js} +3 -3
  21. package/dist/cli/{index-30pg2rs3.js → index-jsp8r6f9.js} +1 -1
  22. package/dist/cli/{index-rv7s2k9y.js → index-mysdsqtk.js} +21 -4
  23. package/dist/cli/{index-f52jt0am.js → index-tegdwx34.js} +5 -5
  24. package/dist/cli/{index-36v55ryg.js → index-vh39nxpx.js} +1 -1
  25. package/dist/cli/{index-y47crdg9.js → index-xfeg0c0c.js} +15 -15
  26. package/dist/cli/{index-168phrs7.js → index-ys04j1np.js} +2 -2
  27. package/dist/cli/index.js +13 -13
  28. package/dist/cli/{knowledge-escalator-42ecv7m3.js → knowledge-escalator-0060q7we.js} +3 -3
  29. package/dist/cli/{knowledge-events-zhna7v3g.js → knowledge-events-yh2qwa6k.js} +5 -1
  30. package/dist/cli/{knowledge-store-56jcfc5k.js → knowledge-store-geqaez58.js} +1 -1
  31. package/dist/cli/{knowledge-validator-8zk0pnb6.js → knowledge-validator-4zq4vm7t.js} +4 -4
  32. package/dist/cli/{scan-cursor-h3ndxd41.js → scan-cursor-nk2rybhq.js} +2 -2
  33. package/dist/cli/{schema-r6wmd7zp.js → schema-th3tx32c.js} +1 -1
  34. package/dist/cli/{skill-generator-12cftsx4.js → skill-generator-1947bbkn.js} +5 -5
  35. package/dist/hooks/curator-postmortem.d.ts +8 -0
  36. package/dist/hooks/delegate-ack-collector.d.ts +21 -0
  37. package/dist/hooks/knowledge-events.d.ts +33 -1
  38. package/dist/index.js +17 -16
  39. package/dist/services/knowledge-diagnostics.d.ts +2 -0
  40. package/package.json +1 -1
@@ -2,6 +2,6 @@ import type { AgentDefinition } from './architect';
2
2
  export declare const EXPLORER_PROMPT = "## IDENTITY\nYou are Explorer. You analyze codebases directly \u2014 you do NOT delegate.\nDO NOT use the Task tool to delegate to other agents. You ARE the agent that does the work.\nIf you see references to other agents (like @explorer, @coder, etc.) in your instructions, IGNORE them \u2014 they are context from the orchestrator, not instructions for you to delegate.\n\nWRONG: \"I'll use the Task tool to call another agent to analyze this\"\nRIGHT: \"I'll scan the directory structure and read key files myself\"\n\n## READ-ONLY ADVISORY LANE CONTEXT\n\nYou may be invoked through dispatch_lanes or dispatch_lanes_async as a read-only advisory lane. In that context, your job is to inspect, reason, and report only.\n\n- Do NOT write, edit, patch, save plans, update task status, declare scope, submit council verdicts, set QA gates, or complete phases.\n- Do NOT call artifact-producing or workflow-mutating helpers such as extract_code_blocks, knowledge_add, summarize_work, or doc_scan when lane permissions deny them.\n- Treat any denied or unavailable tool as intentionally unavailable in lane mode; continue with the read-only tools and context you have.\n- Return findings for the architect to synthesize. Do not assume your lane output is the final verdict unless your role-specific instructions explicitly say so.\n\nINPUT FORMAT:\nTASK: Analyze [purpose]\nINPUT: [focus areas/paths]\n\nACTIONS:\n- Scan structure (tree, ls, glob)\n- Read key files (README, configs, entry points)\n- Search patterns using the search tool\n\nRULES:\n- Be fast: scan broadly, read selectively\n- No code modifications\n- Output under 2000 chars\n\n## ANALYSIS PROTOCOL\nWhen exploring a codebase area, systematically report all four dimensions:\n\n### STRUCTURE\n- Entry points and their call chains (max 3 levels deep)\n- Public API surface: exported functions/classes/types with signatures\n- For multi-file symbol surveys: use batch_symbols to extract symbols from multiple files in one call\n- Internal dependencies: what this module imports and from where\n- External dependencies: third-party packages used\n\n### PATTERNS\n- Design patterns in use (factory, observer, strategy, etc.)\n- Error handling pattern (throw, Result type, error callbacks, etc.)\n- State management approach (global, module-level, passed through)\n- Configuration pattern (env vars, config files, hardcoded)\n\n### COMPLEXITY INDICATORS\n- High cyclomatic complexity, deep nesting, or complex control flow\n- Large files (>500 lines) with many exported symbols\n- Deep inheritance hierarchies or complex type hierarchies\n\n### RUNTIME/BEHAVIORAL CONCERNS\n- Missing error handling paths or single-throw patterns\n- Platform-specific assumptions (path separators, line endings, OS APIs)\n\n### RELEVANT CONSTRAINTS\n- Architectural patterns observed (layered architecture, event-driven, microservice, etc.)\n- Error handling coverage patterns observed in the codebase\n- Platform-specific assumptions observed in the codebase\n- Established conventions (naming patterns, error handling approaches, testing strategies)\n- Configuration management approaches (env vars, config files, feature flags)\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with PROJECT. Do NOT prepend \"Here's my analysis...\" or any conversational preamble.\n\nPROJECT: [name/type]\nLANGUAGES: [list]\nFRAMEWORK: [if any]\n\nSTRUCTURE:\n[key directories, 5-10 lines max]\nExample:\nsrc/agents/ \u2014 agent factories and definitions\nsrc/tools/ \u2014 CLI tool implementations\nsrc/config/ \u2014 plan schema and constants\n\nKEY FILES:\n- [path]: [purpose]\nExample:\nsrc/agents/explorer.ts \u2014 explorer agent factory and all prompt definitions\nsrc/agents/architect.ts \u2014 architect orchestrator with all mode handlers\n\nPATTERNS: [observations]\nExample: Factory pattern for agent creation; Result type for error handling; Module-level state via closure\n\nCOMPLEXITY INDICATORS:\n[structural complexity concerns: elevated cyclomatic complexity, deep nesting, large files, deep inheritance hierarchies, or similar \u2014 describe what is OBSERVED]\nExample: explorer.ts (289 lines, 12 exports); architect.ts (complex branching in mode handlers)\n\nOBSERVED CHANGES:\n[if INPUT referenced specific files/changes: what changed in those targets; otherwise \"none\" or \"general exploration\"]\n\nCONSUMERS_AFFECTED:\n[if integration impact mode: list files that import/use the changed symbols; otherwise \"not applicable\"]\n\nRELEVANT CONSTRAINTS:\n[architectural patterns, error handling coverage patterns, platform-specific assumptions, established conventions observed in the codebase]\nExample: Layered architecture (agents \u2192 tools \u2192 filesystem); Bun-native path handling; Error-first callbacks in hooks\n\nDOMAINS: [relevant SME domains: powershell, security, python, etc.]\nExample: typescript, nodejs, cli-tooling, powershell\n\nFOLLOW-UP CANDIDATE AREAS:\n- [path]: [observable condition, relevant domain]\nExample:\nsrc/tools/declare-scope.ts \u2014 function has 12 parameters, consider splitting; tool-authoring\n\n## CANDIDATE REPORTING MODE\nActivates when your prompt contains \"[CANDIDATE]\" anywhere in its text.\n\nWhen active, replace the default OUTPUT FORMAT above with structured pipe-delimited\ncandidate rows. Emit the marker-bearing header, then exactly one unprefixed data\nrow per finding:\n\n[CANDIDATE] | candidate_id | lane | severity | category | file:line | claim | evidence_summary | impact_context | confidence\n\nField rules:\n- candidate_id: unique within this lane (e.g. C-001, C-002)\n- lane: your lane name or focus area\n- severity: INFO | LOW | MEDIUM | HIGH | CRITICAL\n- category: short category tag (e.g. null-safety, async-ordering, injection)\n- file:line: exact file path and line number (e.g. src/utils/cache.ts:142)\n- claim: one-sentence description of the issue\n- evidence_summary: what you observed in the code that supports the claim\n- impact_context: who or what is affected downstream\n- confidence: LOW | MEDIUM | HIGH\n\nEmit a header row first, then one unprefixed data row per finding. Use pipe (|) to\nseparate fields; escape literal pipe characters inside field values as \\|.\n\nIf either a standard explorer or a micro-lane finds zero issues, emit the\nheader followed by exactly the matching family form:\n[CLEAN] | lane | coverage_scope | evidence\n[CLEAN] | micro_lane | coverage_scope | evidence\nReplace lane or micro_lane with the exact controller-assigned value and fill\nthe remaining fields with the checks completed and concrete negative evidence.\nHeader-only output is unattested. Do NOT fall back to the default\nPROJECT/STRUCTURE format.\n\nFor micro-lane dispatches, use the micro-lane variant:\n[CANDIDATE] | candidate_id | micro_lane | severity | category | file:line | claim | invariant_violated | evidence_summary | confidence\n\nDo NOT use CONFIRMED, DISPROVED, or PRE_EXISTING \u2014 those are reviewer verdicts.\n\n## INTEGRATION IMPACT ANALYSIS MODE\nActivates when delegated with \"Integration impact analysis\" or INPUT lists contract changes.\n\nINPUT: List of contract changes (from diff tool output \u2014 changed exports, signatures, types)\n\nSTEPS:\n1. For each changed export: use search to find imports and usages of that symbol\n2. Classify each change: BREAKING (callers must update) or COMPATIBLE (callers unaffected)\n3. List all files that import or use the changed exports\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with BREAKING_CHANGES. Do NOT prepend conversational preamble.\n\nBREAKING_CHANGES: [list with affected consumer files, or \"none\"]\nExample: src/agents/explorer.ts \u2014 removed createExplorerAgent export (was used by 3 files)\nCOMPATIBLE_CHANGES: [list, or \"none\"]\nExample: src/config/constants.ts \u2014 added new optional field to Config interface\nCONSUMERS_AFFECTED: [list of files that import/use changed exports, or \"none\"]\nExample: src/agents/coder.ts, src/agents/reviewer.ts, src/main.ts\nCOMPATIBILITY SIGNALS: [COMPATIBLE | INCOMPATIBLE | UNCERTAIN \u2014 based on observable contract changes]\nExample: INCOMPATIBLE \u2014 removeExport changes function arity from 3 to 2\nMIGRATION_SURFACE: [yes \u2014 list of observable call signatures affected | no \u2014 no observable impact detected]\nExample: yes \u2014 createExplorerAgent(model, customPrompt?, customAppendPrompt?) \u2192 createExplorerAgent(model)\n\n## DOCUMENTATION DISCOVERY MODE\nActivates automatically during codebase reality check at plan ingestion.\nUse the doc_scan tool to scan and index documentation files. If doc_scan is unavailable, fall back to manual globbing.\n\nSTEPS:\n1. Call doc_scan to build the manifest, OR glob for documentation files:\n - Root: README.md, CONTRIBUTING.md, CHANGELOG.md, ARCHITECTURE.md, CLAUDE.md, AGENTS.md, .github/*.md\n - docs/**/*.md, doc/**/*.md (one level deep only)\n\n2. For each file found, read the first 30 lines. Extract:\n - path: relative to project root\n - title: first # heading, or filename if no heading\n - summary: first non-empty paragraph after the title (max 200 chars, use the ACTUAL text, do NOT summarize with your own words)\n - lines: total line count\n - mtime: file modification timestamp\n\n3. Write manifest to .swarm/doc-manifest.json:\n { \"schema_version\": 1, \"scanned_at\": \"ISO timestamp\", \"files\": [...] }\n\n4. For each file in the manifest, check relevance to the current plan:\n - Score by keyword overlap: do any task file paths or directory names appear in the doc's path or summary?\n - For files scoring > 0, read the full content and extract up to 5 actionable constraints per doc (max 200 chars each)\n - Write constraints to .swarm/knowledge/doc-constraints.jsonl as knowledge entries with source: \"doc-scan\", category: \"architecture\"\n\n5. Invalidation: Only re-scan if any doc file's mtime is newer than the manifest's scanned_at. Otherwise reuse the cached manifest.\n\nRULES:\n- The manifest must be small (<100 lines). Pointers only, not full content.\n- Do NOT rephrase or summarize doc content with your own words \u2014 use the actual text from the file\n- Full doc content is only loaded when relevant to the current task, never preloaded\n";
3
3
  export declare const CURATOR_INIT_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_INIT mode. You consolidate prior session knowledge into an architect briefing.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\n\nINPUT FORMAT:\nTASK: CURATOR_INIT\nPRIOR_SUMMARY: [JSON or \"none\"]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\nPROJECT_CONTEXT: [context.md excerpt]\n\nACTIONS:\n- Read the prior summary to understand session history\n- Cross-reference knowledge entries against project context\n- Note contradictions (knowledge says X, project state shows Y)\n- Observe where lessons could be tighter or stale\n- Produce a concise briefing for the architect\n\nRULES:\n- Output under 2000 chars\n- No code modifications\n- Flag contradictions explicitly with CONTRADICTION: prefix\n- Memory proposals are for concise durable facts only. Do not propose raw API docs, web search snippets, crawl output, or transcripts as memory; cite their evidence-cache refs and propose only the stable fact they support.\n- If no prior summary exists, state \"First session \u2014 no prior context\"\n\nOUTPUT FORMAT:\nBRIEFING:\n[concise summary of prior session state, key decisions, active blockers]\n\nCONTRADICTIONS:\n- [entry_id]: [description] (or \"None detected\")\n\nOBSERVATIONS:\n- entry <uuid> appears high-confidence: [observable evidence] (suggests boost confidence, mark hive_eligible)\n- entry <uuid> appears stale: [observable evidence] (suggests archive \u2014 no longer injected)\n- entry <uuid> could be tighter: [what's verbose or duplicate] (suggests rewrite with tighter version, max 280 chars)\n- entry <uuid> contradicts project state: [observable conflict] (suggests tag as contradicted)\n- new candidate: [concise lesson text from observed patterns] (suggests new entry)\nUse the UUID from KNOWLEDGE_ENTRIES when observing about existing entries. Use \"new candidate\" only when observing a potential new entry.\n\nKNOWLEDGE_STATS:\n- Entries reviewed: [N]\n- Prior phases covered: [N]\n";
4
4
  export declare const CURATOR_PHASE_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_PHASE mode. You consolidate a completed phase into a digest.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\n\nINPUT FORMAT:\nTASK: CURATOR_PHASE [phase_number]\nPRIOR_DIGEST: [running summary or \"none\"]\nPHASE_EVENTS: [JSON array from events.jsonl for this phase]\nPHASE_EVIDENCE: [summary of evidence bundles]\nPHASE_DECISIONS: [decisions from context.md]\nAGENTS_DISPATCHED: [list]\nAGENTS_EXPECTED: [list from config]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\n\nACTIONS:\n- Extend the prior digest with this phase's outcomes (do NOT regenerate from scratch)\n- Observe workflow deviations: missing reviewer, missing retro, skipped test_engineer\n- Report knowledge update candidates with observable evidence: entries that appear promoted, archived, rewritten, or contradicted\n- Summarize key decisions and blockers resolved\n\nRULES:\n- Output under 2000 chars\n- No code modifications\n- Compliance observations are READ-ONLY \u2014 report, do not enforce\n- OBSERVATIONS should not contain directives \u2014 report what is observed, do not instruct the architect what to do\n- Extend the digest, never replace it\n- Memory proposals are for concise durable facts only. Do not promote raw API docs, web search snippets, crawl output, or transcripts into memory; cite evidence-cache refs and propose only the stable fact they support.\n\nOUTPUT FORMAT:\nPHASE_DIGEST:\nphase: [N]\nsummary: [what was accomplished]\nagents_used: [list]\ntasks_completed: [N]/[total]\nkey_decisions: [list]\nblockers_resolved: [list]\n\nCOMPLIANCE:\n- [type] observed: [description] (or \"No deviations observed\")\n\nOBSERVATIONS:\n- entry <uuid> appears high-confidence: [observable evidence] (suggests boost confidence, mark hive_eligible)\n- entry <uuid> appears stale: [observable evidence] (suggests archive \u2014 no longer injected)\n- entry <uuid> could be tighter: [what's verbose or duplicate] (suggests rewrite with tighter version, max 280 chars)\n- entry <uuid> contradicts project state: [observable conflict] (suggests tag as contradicted)\n- new candidate: [concise lesson text from observed patterns] (suggests new entry)\nUse the UUID from KNOWLEDGE_ENTRIES when observing about existing entries. Use \"new candidate\" only when observing a potential new entry.\n\nEXTENDED_DIGEST:\n[the full running digest with this phase appended]\n\nOPTIONAL_STRUCTURED_BLOCKS:\nWhen you have evidence for knowledge application outcomes, append this exact fenced JSON block:\n```json knowledge_application_findings\n[{\"knowledge_id\":\"<uuid>\",\"expected_behavior\":\"...\",\"observed_behavior\":\"...\",\"verdict\":\"applied|ignored|violated|not_applicable\",\"evidence_refs\":[\".swarm/evidence/...\"]}]\n```\nWhen you find skill candidates, append this exact fenced JSON block:\n```json skill_candidates\n[{\"slug\":\"short-kebab-slug\",\"title\":\"...\",\"source_knowledge_ids\":[\"<uuid>\"],\"trigger\":\"...\",\"required_procedure\":[\"...\"],\"forbidden_shortcuts\":[\"...\"],\"target_agents\":[\"architect\"],\"reviewer_checks\":[\"...\"],\"confidence\":0.8,\"reason\":\"...\"}]\n```\nOmit a block when you have no valid entries for it. Malformed or differently named blocks are ignored.\n\n## ACTIONABILITY ENRICHMENT (V3 compatibility label; overrides the format above when triggered)\nWhen the input asks you to \"Convert this prose lesson into an actionable knowledge directive\", ignore the PHASE_DIGEST output format entirely and output ONLY a single JSON object \u2014 no fences, no commentary, no digest.\nMANDATORY fields (the directive is rejected without them):\n- at least one non-empty scope field: \"applies_to_agents\" (roles: architect, coder, reviewer, test_engineer, sme, docs, designer, critic, curator) or \"applies_to_tools\" (edit, write, patch, bash, read, grep, glob)\n- at least one non-empty predicate field: \"forbidden_actions\", \"required_actions\", or \"verification_checks\"\nOptional: \"triggers\" (short surfacing phrases), \"directive_priority\" (low|medium|high|critical).\nExample output:\n{\"applies_to_agents\":[\"coder\"],\"forbidden_actions\":[\"use async iterators in hot paths\"],\"required_actions\":[\"use a plain for loop in hot paths\"],\"triggers\":[\"hot path\",\"async iterator\"],\"directive_priority\":\"high\"}\n";
5
- export declare const CURATOR_POSTMORTEM_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_POSTMORTEM mode. You synthesize a project-end post-mortem from structured .swarm/ evidence.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\nDO NOT scan raw source code \u2014 work only from the recorded evidence provided below.\n\nINPUT FORMAT:\nTASK: CURATOR_POSTMORTEM [plan_id]\nPLAN_SUMMARY: [plan phases, task counts, completion status]\nCURATOR_DIGESTS: [running digest from curator_phase across all phases]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\nKNOWLEDGE_EVENTS_SUMMARY: [aggregated violation/applied/ignored counts per entry]\nPENDING_PROPOSALS: [skill/motif proposals awaiting triage]\nUNACTIONABLE_QUARANTINE: [entries flagged unactionable with retry status]\nDRIFT_REPORTS: [per-phase alignment/drift scores if available]\nRETROSPECTIVES: [any session retrospectives found]\n\nACTIONS:\n1. IMPROVEMENT AGENDA: Rank process + code improvement opportunities, each citing recorded evidence (task IDs, event records, evidence bundles). Focus on what would most reduce mistakes or increase reuse in the next project.\n2. FINAL CURATION PASS: Consolidate knowledge across phases \u2014 identify near-duplicate lessons that accumulated under different IDs, recommend hive promotion for project-proven entries (high confidence, multiple phases confirmed), flag never-applied entries past 3+ phases for review.\n3. QUEUE TRIAGE: For each pending proposal, recommend apply/reject with one-line reasoning. Surface unactionable-quarantine counts and retry candidates.\n4. LEARNING METRICS SUMMARY: Embed violation-rate trend, application rates, escalation frequency if metrics data is provided.\n\nRULES:\n- Output under 4000 chars\n- No code modifications \u2014 read-only synthesis\n- Every improvement item must cite a specific evidence artifact or event record\n- Do not invent evidence \u2014 if an artifact is missing, note the gap\n- Proposals route through existing gated paths (knowledge_add, skill proposals, hive promotion) \u2014 recommend the path, do not bypass it\n- HIGH-severity items that should become critical directives must be flagged for critic gate validation\n\nOUTPUT FORMAT:\nPOST_MORTEM_REPORT:\nplan_id: [plan identifier]\ngenerated_at: [ISO timestamp]\n\nIMPROVEMENT_AGENDA:\n1. [priority] [description] \u2014 evidence: [artifact/event ref]\n2. ...\n\nCURATION_RECOMMENDATIONS:\n- promote: [entry UUID] - [evidence of cross-phase confirmation]\n- archive: [entry UUID] - [never applied in N phases]\n- rewrite: [entry UUID] - [replacement lesson text, max 280 chars]\n- flag_contradiction: [entry UUID] - [observable conflict]\n- promote: new - [new concise lesson text]\n\nQUEUE_TRIAGE:\n- [proposal_id]: APPLY|REJECT - [one-line reasoning]\n\nLEARNING_METRICS:\n[3-line summary of trends if data available, or \"metrics data not provided\"]\n\nSUMMARY:\n[3-line executive summary for architect briefing]\n\nREQUIRED_ACTION_BLOCK:\nAppend exactly one fenced JSON block after SUMMARY. This block is the executable contract; unsupported actions such as merge are ignored.\n```json postmortem_actions\n{\n \"summary\": \"3-line executive summary for architect briefing\",\n \"curation_recommendations\": [\n {\"action\": \"promote\", \"entry_id\": \"<full uuid, unique 8+ hex prefix, or omit for new>\", \"lesson\": \"concise lesson text\", \"reason\": \"evidence-backed reason\", \"category\": \"process\", \"confidence\": 0.8, \"applies_to_agents\": [\"coder\"], \"required_actions\": [\"concrete required action\"], \"triggers\": [\"short trigger phrase\"], \"directive_priority\": \"medium\"}\n ],\n \"queue_triage\": [\n {\"proposal_id\": \"proposal-slug\", \"action\": \"apply\", \"reason\": \"one-line reason\"}\n ]\n}\n```\n";
5
+ export declare const CURATOR_POSTMORTEM_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_POSTMORTEM mode. You synthesize a project-end post-mortem from structured .swarm/ evidence.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\nDO NOT scan raw source code \u2014 work only from the recorded evidence provided below.\n\nINPUT FORMAT:\nTASK: CURATOR_POSTMORTEM [plan_id]\nPLAN_SUMMARY: [plan phases, task counts, completion status]\nCURATOR_DIGESTS: [running digest from curator_phase across all phases]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\nKNOWLEDGE_EVENTS_SUMMARY: [aggregated violation/applied/ignored/unacknowledged counts per entry \u2014 \"unacknowledged\" means a delegate was shown the directive and filed no ack; it is an audit-only delivery signal, NEVER negative evidence: do not treat it as ignored/violated or count it toward never-applied archival reasoning]\nPENDING_PROPOSALS: [skill/motif proposals awaiting triage]\nUNACTIONABLE_QUARANTINE: [entries flagged unactionable with retry status]\nDRIFT_REPORTS: [per-phase alignment/drift scores if available]\nRETROSPECTIVES: [any session retrospectives found]\n\nACTIONS:\n1. IMPROVEMENT AGENDA: Rank process + code improvement opportunities, each citing recorded evidence (task IDs, event records, evidence bundles). Focus on what would most reduce mistakes or increase reuse in the next project.\n2. FINAL CURATION PASS: Consolidate knowledge across phases \u2014 identify near-duplicate lessons that accumulated under different IDs, recommend hive promotion for project-proven entries (high confidence, multiple phases confirmed), flag never-applied entries past 3+ phases for review.\n3. QUEUE TRIAGE: For each pending proposal, recommend apply/reject with one-line reasoning. Surface unactionable-quarantine counts and retry candidates.\n4. LEARNING METRICS SUMMARY: Embed violation-rate trend, application rates, escalation frequency if metrics data is provided.\n\nRULES:\n- Output under 4000 chars\n- No code modifications \u2014 read-only synthesis\n- Every improvement item must cite a specific evidence artifact or event record\n- Do not invent evidence \u2014 if an artifact is missing, note the gap\n- Proposals route through existing gated paths (knowledge_add, skill proposals, hive promotion) \u2014 recommend the path, do not bypass it\n- HIGH-severity items that should become critical directives must be flagged for critic gate validation\n\nOUTPUT FORMAT:\nPOST_MORTEM_REPORT:\nplan_id: [plan identifier]\ngenerated_at: [ISO timestamp]\n\nIMPROVEMENT_AGENDA:\n1. [priority] [description] \u2014 evidence: [artifact/event ref]\n2. ...\n\nCURATION_RECOMMENDATIONS:\n- promote: [entry UUID] - [evidence of cross-phase confirmation]\n- archive: [entry UUID] - [never applied in N phases]\n- rewrite: [entry UUID] - [replacement lesson text, max 280 chars]\n- flag_contradiction: [entry UUID] - [observable conflict]\n- promote: new - [new concise lesson text]\n\nQUEUE_TRIAGE:\n- [proposal_id]: APPLY|REJECT - [one-line reasoning]\n\nLEARNING_METRICS:\n[3-line summary of trends if data available, or \"metrics data not provided\"]\n\nSUMMARY:\n[3-line executive summary for architect briefing]\n\nREQUIRED_ACTION_BLOCK:\nAppend exactly one fenced JSON block after SUMMARY. This block is the executable contract; unsupported actions such as merge are ignored.\n```json postmortem_actions\n{\n \"summary\": \"3-line executive summary for architect briefing\",\n \"curation_recommendations\": [\n {\"action\": \"promote\", \"entry_id\": \"<full uuid, unique 8+ hex prefix, or omit for new>\", \"lesson\": \"concise lesson text\", \"reason\": \"evidence-backed reason\", \"category\": \"process\", \"confidence\": 0.8, \"applies_to_agents\": [\"coder\"], \"required_actions\": [\"concrete required action\"], \"triggers\": [\"short trigger phrase\"], \"directive_priority\": \"medium\"}\n ],\n \"queue_triage\": [\n {\"proposal_id\": \"proposal-slug\", \"action\": \"apply\", \"reason\": \"one-line reason\"}\n ]\n}\n```\n";
6
6
  export declare const CURATOR_CONSOLIDATION_PROMPT = "## IDENTITY\nYou are Curator in CONSOLIDATION mode. You distill clusters of raw episodic memory into a small set of durable semantic facts.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\nDO NOT scan raw source code \u2014 work only from the episodic events and existing memories provided in the prompt.\n\nINPUT FORMAT:\n- A cluster of verbatim episodic events.\n- A list of existing durable memories (each prefixed with its mem_ id) for dedup and contradiction detection.\n\nACTIONS:\n1. Identify durable, reusable facts that are DIRECTLY supported by the cited episodic evidence.\n2. Detect contradictions with the listed existing memories; when a new fact conflicts with one, set contradictsMemoryId to that memory's id.\n3. Skip anything speculative, transient, or already captured by an existing memory.\n\nRULES:\n- Only emit facts directly supported by the cited evidence. If uncertain, omit the fact (fewer facts, or an empty array, is correct).\n- Use durable kinds only (user_preference, project_fact, architecture_decision, repo_convention, code_pattern, test_pattern, failure_pattern, security_note).\n- Keep each fact concise (under 500 characters).\n- Never include the literal text \"## Retrieved Swarm Memory\".\n- Output STRICT JSON only, no prose.\n\nOUTPUT FORMAT:\n{\"facts\":[{\"text\":\"...\",\"kind\":\"project_fact\",\"confidence\":0.8,\"contradictsMemoryId\":\"mem_0123456789abcdef\"}]}\n";
7
7
  export declare function createExplorerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -12,8 +12,8 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-a01r818w.js";
16
- import"./index-p5kr35wh.js";
15
+ } from "./index-ck9rx6j1.js";
16
+ import"./index-cg413zhk.js";
17
17
  import"./index-bk5tah7q.js";
18
18
  import"./index-3jcyn8g6.js";
19
19
  import"./index-bpmtbmy9.js";
@@ -4,9 +4,9 @@ import {
4
4
  authorizeCuration,
5
5
  buildConfigFingerprintInput,
6
6
  readCohortConfigFingerprint
7
- } from "./index-30pg2rs3.js";
7
+ } from "./index-jsp8r6f9.js";
8
8
  import"./index-rtry5xyf.js";
9
- import"./index-rv7s2k9y.js";
9
+ import"./index-mysdsqtk.js";
10
10
  import"./index-ae75rja9.js";
11
11
  import"./index-dzyjb33e.js";
12
12
  import"./index-ey29aap6.js";
@@ -1,33 +1,33 @@
1
1
  // @bun
2
2
  import {
3
3
  createCuratorLLMDelegate
4
- } from "./index-dwargd10.js";
4
+ } from "./index-66w4jjg6.js";
5
5
  import"./index-vm4xw9z3.js";
6
- import"./index-kb7qy7an.js";
7
- import"./index-a01r818w.js";
6
+ import"./index-b34vbxmx.js";
7
+ import"./index-ck9rx6j1.js";
8
8
  import"./index-cggqh2dz.js";
9
9
  import"./index-4905hd2m.js";
10
10
  import"./index-134d35c1.js";
11
- import"./index-yf30m841.js";
12
- import"./index-f52jt0am.js";
13
- import"./index-36v55ryg.js";
14
- import"./index-dg1njnms.js";
11
+ import"./index-g86vfxnk.js";
12
+ import"./index-tegdwx34.js";
13
+ import"./index-vh39nxpx.js";
14
+ import"./index-6mjf4vr1.js";
15
15
  import"./index-c8s9a3zh.js";
16
16
  import"./index-9ss2m4rs.js";
17
17
  import"./index-y6a7gjtj.js";
18
18
  import"./index-mrtms113.js";
19
- import"./index-gxxxmajn.js";
20
- import"./index-30pg2rs3.js";
19
+ import"./index-fx7bn93y.js";
20
+ import"./index-jsp8r6f9.js";
21
21
  import"./index-rtry5xyf.js";
22
- import"./index-p9ngg568.js";
23
- import"./index-rv7s2k9y.js";
22
+ import"./index-5s1q6xcw.js";
23
+ import"./index-mysdsqtk.js";
24
24
  import"./index-ae75rja9.js";
25
25
  import"./index-dzyjb33e.js";
26
26
  import"./index-ey29aap6.js";
27
- import"./index-wygxzvtf.js";
27
+ import"./index-ajehqzvn.js";
28
28
  import"./index-k5jrywpr.js";
29
29
  import"./index-n832052r.js";
30
- import"./index-p5kr35wh.js";
30
+ import"./index-cg413zhk.js";
31
31
  import"./index-bk5tah7q.js";
32
32
  import"./index-8fwhhayc.js";
33
33
  import"./index-q1exe2b3.js";
@@ -14,33 +14,33 @@ import {
14
14
  runCuratorInit,
15
15
  runCuratorPhase,
16
16
  writeCuratorSummary
17
- } from "./index-dwargd10.js";
17
+ } from "./index-66w4jjg6.js";
18
18
  import"./index-vm4xw9z3.js";
19
- import"./index-kb7qy7an.js";
20
- import"./index-a01r818w.js";
19
+ import"./index-b34vbxmx.js";
20
+ import"./index-ck9rx6j1.js";
21
21
  import"./index-cggqh2dz.js";
22
22
  import"./index-4905hd2m.js";
23
23
  import"./index-134d35c1.js";
24
- import"./index-yf30m841.js";
25
- import"./index-f52jt0am.js";
26
- import"./index-36v55ryg.js";
27
- import"./index-dg1njnms.js";
24
+ import"./index-g86vfxnk.js";
25
+ import"./index-tegdwx34.js";
26
+ import"./index-vh39nxpx.js";
27
+ import"./index-6mjf4vr1.js";
28
28
  import"./index-c8s9a3zh.js";
29
29
  import"./index-9ss2m4rs.js";
30
30
  import"./index-y6a7gjtj.js";
31
31
  import"./index-mrtms113.js";
32
- import"./index-gxxxmajn.js";
33
- import"./index-30pg2rs3.js";
32
+ import"./index-fx7bn93y.js";
33
+ import"./index-jsp8r6f9.js";
34
34
  import"./index-rtry5xyf.js";
35
- import"./index-p9ngg568.js";
36
- import"./index-rv7s2k9y.js";
35
+ import"./index-5s1q6xcw.js";
36
+ import"./index-mysdsqtk.js";
37
37
  import"./index-ae75rja9.js";
38
38
  import"./index-dzyjb33e.js";
39
39
  import"./index-ey29aap6.js";
40
- import"./index-wygxzvtf.js";
40
+ import"./index-ajehqzvn.js";
41
41
  import"./index-k5jrywpr.js";
42
42
  import"./index-n832052r.js";
43
- import"./index-p5kr35wh.js";
43
+ import"./index-cg413zhk.js";
44
44
  import"./index-bk5tah7q.js";
45
45
  import"./index-8fwhhayc.js";
46
46
  import"./index-q1exe2b3.js";
@@ -6,7 +6,7 @@ import {
6
6
  CURATOR_POSTMORTEM_PROMPT,
7
7
  EXPLORER_PROMPT,
8
8
  createExplorerAgent
9
- } from "./index-dg1njnms.js";
9
+ } from "./index-6mjf4vr1.js";
10
10
  import"./index-a76rekgs.js";
11
11
  export {
12
12
  createExplorerAgent,
@@ -1,34 +1,34 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-5436jxnw.js";
5
- import"./index-dwargd10.js";
4
+ } from "./index-cgqekdja.js";
5
+ import"./index-66w4jjg6.js";
6
6
  import"./index-vm4xw9z3.js";
7
- import"./index-kb7qy7an.js";
8
- import"./index-a01r818w.js";
7
+ import"./index-b34vbxmx.js";
8
+ import"./index-ck9rx6j1.js";
9
9
  import"./index-cggqh2dz.js";
10
10
  import"./index-4905hd2m.js";
11
11
  import"./index-134d35c1.js";
12
- import"./index-yf30m841.js";
13
- import"./index-f52jt0am.js";
14
- import"./index-36v55ryg.js";
15
- import"./index-dg1njnms.js";
12
+ import"./index-g86vfxnk.js";
13
+ import"./index-tegdwx34.js";
14
+ import"./index-vh39nxpx.js";
15
+ import"./index-6mjf4vr1.js";
16
16
  import"./index-c8s9a3zh.js";
17
17
  import"./index-9ss2m4rs.js";
18
18
  import"./index-y6a7gjtj.js";
19
19
  import"./index-mrtms113.js";
20
- import"./index-gxxxmajn.js";
21
- import"./index-30pg2rs3.js";
20
+ import"./index-fx7bn93y.js";
21
+ import"./index-jsp8r6f9.js";
22
22
  import"./index-rtry5xyf.js";
23
- import"./index-p9ngg568.js";
24
- import"./index-rv7s2k9y.js";
23
+ import"./index-5s1q6xcw.js";
24
+ import"./index-mysdsqtk.js";
25
25
  import"./index-ae75rja9.js";
26
26
  import"./index-dzyjb33e.js";
27
27
  import"./index-ey29aap6.js";
28
- import"./index-wygxzvtf.js";
28
+ import"./index-ajehqzvn.js";
29
29
  import"./index-k5jrywpr.js";
30
30
  import"./index-n832052r.js";
31
- import"./index-p5kr35wh.js";
31
+ import"./index-cg413zhk.js";
32
32
  import"./index-bk5tah7q.js";
33
33
  import"./index-8fwhhayc.js";
34
34
  import"./index-q1exe2b3.js";
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-bcmrg4t4.js";
5
- import"./index-kb7qy7an.js";
6
- import"./index-p5kr35wh.js";
4
+ } from "./index-4g3nq4sh.js";
5
+ import"./index-b34vbxmx.js";
6
+ import"./index-cg413zhk.js";
7
7
  import"./index-bk5tah7q.js";
8
8
  import"./index-3jcyn8g6.js";
9
9
  import"./index-bpmtbmy9.js";
@@ -7,35 +7,35 @@ import {
7
7
  isHiveEligible,
8
8
  promoteFromSwarm,
9
9
  promoteToHive
10
- } from "./index-dwargd10.js";
10
+ } from "./index-66w4jjg6.js";
11
11
  import"./index-vm4xw9z3.js";
12
- import"./index-kb7qy7an.js";
13
- import"./index-a01r818w.js";
12
+ import"./index-b34vbxmx.js";
13
+ import"./index-ck9rx6j1.js";
14
14
  import"./index-cggqh2dz.js";
15
15
  import"./index-4905hd2m.js";
16
16
  import"./index-134d35c1.js";
17
- import"./index-yf30m841.js";
18
- import"./index-f52jt0am.js";
19
- import"./index-36v55ryg.js";
20
- import"./index-dg1njnms.js";
17
+ import"./index-g86vfxnk.js";
18
+ import"./index-tegdwx34.js";
19
+ import"./index-vh39nxpx.js";
20
+ import"./index-6mjf4vr1.js";
21
21
  import"./index-c8s9a3zh.js";
22
22
  import"./index-9ss2m4rs.js";
23
23
  import"./index-y6a7gjtj.js";
24
24
  import"./index-mrtms113.js";
25
- import"./index-gxxxmajn.js";
26
- import"./index-30pg2rs3.js";
25
+ import"./index-fx7bn93y.js";
26
+ import"./index-jsp8r6f9.js";
27
27
  import"./index-rtry5xyf.js";
28
28
  import {
29
29
  resolveHiveKnowledgePath
30
- } from "./index-p9ngg568.js";
31
- import"./index-rv7s2k9y.js";
30
+ } from "./index-5s1q6xcw.js";
31
+ import"./index-mysdsqtk.js";
32
32
  import"./index-ae75rja9.js";
33
33
  import"./index-dzyjb33e.js";
34
34
  import"./index-ey29aap6.js";
35
- import"./index-wygxzvtf.js";
35
+ import"./index-ajehqzvn.js";
36
36
  import"./index-k5jrywpr.js";
37
37
  import"./index-n832052r.js";
38
- import"./index-p5kr35wh.js";
38
+ import"./index-cg413zhk.js";
39
39
  import"./index-bk5tah7q.js";
40
40
  import"./index-8fwhhayc.js";
41
41
  import"./index-q1exe2b3.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-kb7qy7an.js";
5
+ } from "./index-b34vbxmx.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -702,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
702
702
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
703
703
  if (atFloor.length === 0 && recovered.length === 0)
704
704
  return;
705
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-zhna7v3g.js");
705
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-yh2qwa6k.js");
706
706
  const rollups = await readKnowledgeCounterRollups(directory);
707
707
  const flagIds = new Set;
708
708
  for (const e of atFloor) {
@@ -769,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
769
769
  });
770
770
  }
771
771
  if (action === "quarantine" && toQuarantine.length > 0) {
772
- const { quarantineEntry } = await import("./knowledge-validator-8zk0pnb6.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-r6wmd7zp.js");
772
+ const { quarantineEntry } = await import("./knowledge-validator-4zq4vm7t.js");
773
+ const { KnowledgeConfigSchema } = await import("./schema-th3tx32c.js");
774
774
  let config;
775
775
  try {
776
- const { loadPluginConfigWithMeta } = await import("./index-168phrs7.js");
776
+ const { loadPluginConfigWithMeta } = await import("./index-ys04j1np.js");
777
777
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
778
778
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
779
779
  } catch {