opencode-swarm 7.103.3 → 7.105.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/.opencode/skills/commit-pr/SKILL.md +15 -7
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +7 -0
- package/.opencode/skills/swarm-pr-review/SKILL.md +6 -0
- package/.opencode/skills/swarm-pr-subscribe/SKILL.md +176 -0
- package/dist/background/pr-event-delivery.d.ts +107 -0
- package/dist/background/pr-event-subscribers.d.ts +36 -7
- package/dist/cli/{config-doctor-4rxjsg22.js → config-doctor-4dhkq5qe.js} +2 -2
- package/dist/cli/{guardrail-explain-7c857j83.js → guardrail-explain-9br76zh5.js} +5 -5
- package/dist/cli/{guardrail-log-vg0atkrx.js → guardrail-log-peftzya3.js} +3 -3
- package/dist/cli/{index-9zb70qfe.js → index-25bc7j87.js} +1 -1
- package/dist/cli/{index-m9keg83x.js → index-50qqqbrb.js} +1 -1
- package/dist/cli/{index-ga7et2xw.js → index-5qzchq7p.js} +28 -1
- package/dist/cli/{index-fhn62ce4.js → index-8mj10cds.js} +8 -6
- package/dist/cli/{index-h0h4qjmc.js → index-hxnnp4qj.js} +1 -1
- package/dist/cli/{index-ye6zt96v.js → index-qnapygnz.js} +670 -64
- package/dist/cli/{index-60prdx3j.js → index-wg8ars51.js} +2 -2
- package/dist/cli/index.js +4 -4
- package/dist/cli/{schema-az0hgfv0.js → schema-3a02876y.js} +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/memory.d.ts +1 -0
- package/dist/commands/pr-subscribe.d.ts +5 -3
- package/dist/commands/registry.d.ts +12 -4
- package/dist/config/bundled-skills.d.ts +1 -1
- package/dist/config/schema.d.ts +40 -0
- package/dist/council/types.d.ts +9 -0
- package/dist/graph/import-extractor.d.ts +1 -1
- package/dist/hooks/pr-auto-subscribe.d.ts +51 -0
- package/dist/index.js +154 -106
- package/dist/lang/symbol-visibility.d.ts +2 -0
- package/dist/memory/config.d.ts +20 -0
- package/dist/memory/gateway.d.ts +1 -0
- package/dist/memory/index.d.ts +2 -1
- package/dist/memory/maintenance.d.ts +4 -1
- package/dist/memory/provider-pool.d.ts +23 -0
- package/dist/memory/provider.d.ts +53 -0
- package/dist/memory/reward.d.ts +39 -0
- package/dist/memory/schema.d.ts +2 -0
- package/dist/memory/scoring.d.ts +2 -0
- package/dist/memory/sqlite-provider.d.ts +53 -1
- package/dist/memory/types.d.ts +5 -0
- package/dist/tools/convene-council.d.ts +2 -0
- package/dist/tools/repo-graph/builder.d.ts +4 -2
- package/dist/tools/submit-phase-council-verdicts.d.ts +1 -0
- package/dist/tools/symbols.d.ts +2 -0
- package/package.json +2 -1
|
@@ -32,6 +32,8 @@ export interface SymbolVisibilityContext {
|
|
|
32
32
|
explicitExported: boolean;
|
|
33
33
|
commonJsExport?: CommonJsExportInfo;
|
|
34
34
|
pythonAllNames?: Set<string> | null;
|
|
35
|
+
/** For Python methods: true if the enclosing class is exported (in __all__ or public naming convention) */
|
|
36
|
+
pythonParentClassExported?: boolean;
|
|
35
37
|
}
|
|
36
38
|
export declare function collectCommonJsExports(source: string): Map<string, CommonJsExportInfo>;
|
|
37
39
|
export declare function collectPythonAllNames(source: string): Set<string> | null;
|
package/dist/memory/config.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface MemoryConfig {
|
|
|
19
19
|
tokenBudget: number;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
learning: MemoryLearningConfig;
|
|
22
23
|
writes: {
|
|
23
24
|
mode: 'propose';
|
|
24
25
|
};
|
|
@@ -84,9 +85,28 @@ export interface ConsolidationConfig {
|
|
|
84
85
|
*/
|
|
85
86
|
decayHalfLifeDays: Record<MemoryKind, number>;
|
|
86
87
|
}
|
|
88
|
+
export interface MemoryLearningConfig {
|
|
89
|
+
learningRate: number;
|
|
90
|
+
propagationFactor: number;
|
|
91
|
+
qValueBoostWeight: number;
|
|
92
|
+
suppressionThreshold: number;
|
|
93
|
+
promotionThreshold: number;
|
|
94
|
+
propagationTokenOverlapThreshold: number;
|
|
95
|
+
/**
|
|
96
|
+
* Minimum cosine similarity (embedding space) for a candidate memory to
|
|
97
|
+
* qualify for soft propagation via the embedding path, independent of the
|
|
98
|
+
* token-overlap path. Only evaluated when `embeddings.enabled` is true and
|
|
99
|
+
* the configured embedding provider is available; otherwise propagation
|
|
100
|
+
* falls back to token-overlap only (issue #1467 acceptance criteria).
|
|
101
|
+
*/
|
|
102
|
+
propagationEmbeddingCosineThreshold: number;
|
|
103
|
+
propagationFanout: number;
|
|
104
|
+
propagationLookbackDays: number;
|
|
105
|
+
}
|
|
87
106
|
export declare const DEFAULT_DECAY_HALF_LIFE_DAYS: Record<MemoryKind, number>;
|
|
88
107
|
export declare const DEFAULT_IMPORTANCE_CONFIG: ImportanceConfig;
|
|
89
108
|
export declare const DEFAULT_CONSOLIDATION_CONFIG: ConsolidationConfig;
|
|
109
|
+
export declare const DEFAULT_MEMORY_LEARNING_CONFIG: MemoryLearningConfig;
|
|
90
110
|
export declare const DEFAULT_EMBEDDINGS_CONFIG: {
|
|
91
111
|
enabled: boolean;
|
|
92
112
|
model: string;
|
package/dist/memory/gateway.d.ts
CHANGED
package/dist/memory/index.d.ts
CHANGED
|
@@ -9,9 +9,10 @@ export { backupLegacyJsonl, getLegacyJsonlFileStatus, type JsonlBackupResult, ty
|
|
|
9
9
|
export { LocalJsonlMemoryProvider } from './local-jsonl-provider';
|
|
10
10
|
export { buildMemoryMaintenanceReport, type MemoryMaintenanceReport, type MemoryMaintenanceReportOptions, type MemoryRecallUsageByMemory, type MemoryRecallUsageByRole, type MemorySupersededChain, shouldCompactMemory, } from './maintenance';
|
|
11
11
|
export { buildRecallPromptBlock } from './prompt-block';
|
|
12
|
-
export type { MemoryCompactOptions, MemoryCompactResult, MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent, MemoryRecallUsageFilter, } from './provider';
|
|
12
|
+
export type { MemoryCompactOptions, MemoryCompactResult, MemoryProposalStore, MemoryProvider, MemoryRecallRewardInput, MemoryRecallRewardResult, MemoryRecallUsageEvent, MemoryRecallUsageFilter, MemoryTaskOutcome, MemoryValueLogEntry, MemoryValueLogFilter, } from './provider';
|
|
13
13
|
export { buildMemoryRecallPlan, type MemoryRecallPlan, type MemoryRecallPlannerInput, } from './recall-planner';
|
|
14
14
|
export { findSecrets, redactSecrets } from './redaction';
|
|
15
|
+
export { applyRecallRewardForCouncil, councilVerdictToMemoryOutcome, resolveRewardRunIds, } from './reward';
|
|
15
16
|
export { MEMORY_RECALL_PROFILES, type MemoryRecallProfile, normalizeMemoryAgentRole, resolveMemoryRecallProfile, } from './role-profiles';
|
|
16
17
|
export { appendMemoryRunLog, sanitizeRunId } from './run-log';
|
|
17
18
|
export { computeMemoryContentHash, createBundleId, createMemoryId, createProposalId, isExpired, normalizeMemoryText, validateCuratorMemoryDecision, validateMemoryProposal, validateMemoryRecordRules, } from './schema';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MemoryProposalStore, MemoryProvider } from './provider';
|
|
1
|
+
import type { MemoryProposalStore, MemoryProvider, MemoryValueLogEntry } from './provider';
|
|
2
2
|
import { type ImportanceWeights } from './scoring';
|
|
3
3
|
import type { MemoryProposal, MemoryRecord } from './types';
|
|
4
4
|
/**
|
|
@@ -40,6 +40,8 @@ export interface MemoryMaintenanceReport {
|
|
|
40
40
|
supersededMemories: MemoryRecord[];
|
|
41
41
|
supersededChains: MemorySupersededChain[];
|
|
42
42
|
lowUtilityMemories: MemoryRecord[];
|
|
43
|
+
lowQValueMemories: MemoryValueLogEntry[];
|
|
44
|
+
promotionCandidates: MemoryValueLogEntry[];
|
|
43
45
|
neverRecalledMemories: MemoryRecord[];
|
|
44
46
|
mostRecalledMemories: MemoryRecallUsageByMemory[];
|
|
45
47
|
recallByAgentRole: MemoryRecallUsageByRole[];
|
|
@@ -59,6 +61,7 @@ export interface MemoryMaintenanceReportOptions {
|
|
|
59
61
|
}
|
|
60
62
|
type ObservableProvider = MemoryProvider & Partial<MemoryProposalStore> & {
|
|
61
63
|
listRecallUsage?: MemoryProvider['listRecallUsage'];
|
|
64
|
+
listMemoryValueLog?: MemoryProvider['listMemoryValueLog'];
|
|
62
65
|
};
|
|
63
66
|
export declare function buildMemoryMaintenanceReport(provider: ObservableProvider, options?: MemoryMaintenanceReportOptions): Promise<MemoryMaintenanceReport>;
|
|
64
67
|
export declare function shouldCompactMemory(memory: MemoryRecord, now?: Date): 'deleted' | 'superseded' | 'expired_scratch' | null;
|
|
@@ -46,5 +46,28 @@ export declare function releaseProvider(provider: MemoryProvider & Partial<Memor
|
|
|
46
46
|
/**
|
|
47
47
|
* Evict and close every cached provider. Intended for test teardown only —
|
|
48
48
|
* production code should rely on LRU eviction.
|
|
49
|
+
*
|
|
50
|
+
* DANGER for production code paths: this force-closes EVERY pooled entry
|
|
51
|
+
* process-wide, bypassing the refCount contract that `releaseProvider()` /
|
|
52
|
+
* `evictLru()` honor — including entries for OTHER directories with active
|
|
53
|
+
* callers (this plugin's module-level pool is shared by every in-process
|
|
54
|
+
* memory operation, per AGENTS.md invariant 8). A production command that
|
|
55
|
+
* needs to force-close its OWN throwaway provider (e.g. before deleting a
|
|
56
|
+
* temp directory) must use `evictAndClose(directory)` instead, which is
|
|
57
|
+
* scoped to a single pool key and leaves every other entry untouched.
|
|
49
58
|
*/
|
|
50
59
|
export declare function clearPool(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Force-close and evict the SINGLE pool entry for `directory` (matched via
|
|
62
|
+
* the same canonical key as `getOrCreateProvider`), regardless of refCount.
|
|
63
|
+
* Every other pooled entry is left completely untouched — safe to call from
|
|
64
|
+
* a scoped, single-directory teardown (e.g. a throwaway eval temp root about
|
|
65
|
+
* to be deleted) without disrupting other in-process callers sharing the
|
|
66
|
+
* pool. No-op if no entry exists for that directory.
|
|
67
|
+
*
|
|
68
|
+
* Bypassing refCount here is intentional and safe ONLY when the caller
|
|
69
|
+
* already knows the directory is being torn down and will never be accessed
|
|
70
|
+
* again (e.g. immediately followed by `fs.rm` on the same path) — it is not
|
|
71
|
+
* a general-purpose substitute for `releaseProvider()`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function evictAndClose(directory: string): void;
|
|
@@ -14,11 +14,62 @@ export interface MemoryRecallUsageEvent {
|
|
|
14
14
|
tokenEstimate: number;
|
|
15
15
|
agentRole?: string;
|
|
16
16
|
runId?: string;
|
|
17
|
+
qValue?: number;
|
|
18
|
+
lastReward?: number;
|
|
19
|
+
taskOutcome?: MemoryTaskOutcome;
|
|
17
20
|
timestamp: string;
|
|
18
21
|
}
|
|
19
22
|
export interface MemoryRecallUsageFilter {
|
|
20
23
|
limit?: number;
|
|
21
24
|
}
|
|
25
|
+
export type MemoryTaskOutcome = 'approved' | 'rejected' | 'concerns' | 'unknown';
|
|
26
|
+
export interface MemoryRecallRewardInput {
|
|
27
|
+
/**
|
|
28
|
+
* Candidate session/run identifiers whose recall-usage bundle(s) should
|
|
29
|
+
* receive this reward. Every id is matched independently (exact match
|
|
30
|
+
* only, no unscoped time-window fallback); all matched bundles are
|
|
31
|
+
* rewarded together. Callers should include every session id known to
|
|
32
|
+
* have actually recalled memory for this task (e.g. dispatched council
|
|
33
|
+
* member sessions), not just the submitting session, so sub-agent
|
|
34
|
+
* recalls are not silently skipped.
|
|
35
|
+
*/
|
|
36
|
+
runIds: string[];
|
|
37
|
+
outcome: MemoryTaskOutcome;
|
|
38
|
+
verdictPayload: unknown;
|
|
39
|
+
timestamp?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface MemoryRecallRewardResult {
|
|
42
|
+
success: boolean;
|
|
43
|
+
/** First matched bundle id, for back-compat display. See `bundleIds` for the full set. */
|
|
44
|
+
bundleId?: string;
|
|
45
|
+
/** Every recall-usage bundle (across all matched runIds) that received this reward. */
|
|
46
|
+
bundleIds?: string[];
|
|
47
|
+
outcome: MemoryTaskOutcome;
|
|
48
|
+
memoryIds: string[];
|
|
49
|
+
updatedMemoryIds: string[];
|
|
50
|
+
propagatedMemoryIds: string[];
|
|
51
|
+
reward: number;
|
|
52
|
+
qValue?: number;
|
|
53
|
+
reason?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface MemoryValueLogEntry {
|
|
56
|
+
memoryId: string;
|
|
57
|
+
kind: MemoryRecord['kind'];
|
|
58
|
+
scopeKey: string;
|
|
59
|
+
textPreview: string;
|
|
60
|
+
qValue: number;
|
|
61
|
+
lastReward?: number;
|
|
62
|
+
taskOutcome?: MemoryTaskOutcome;
|
|
63
|
+
recallCount: number;
|
|
64
|
+
lastRecalledAt?: string;
|
|
65
|
+
promotionCandidate: boolean;
|
|
66
|
+
suppressionCandidate: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface MemoryValueLogFilter {
|
|
69
|
+
limit?: number;
|
|
70
|
+
includePromotionCandidatesOnly?: boolean;
|
|
71
|
+
includeSuppressionCandidatesOnly?: boolean;
|
|
72
|
+
}
|
|
22
73
|
export interface MemoryCompactOptions {
|
|
23
74
|
dryRun?: boolean;
|
|
24
75
|
now?: string;
|
|
@@ -41,6 +92,8 @@ export interface MemoryProvider {
|
|
|
41
92
|
recallWithDiagnostics?(request: RecallRequest): Promise<MemoryRecallResult>;
|
|
42
93
|
recordRecallUsage?(event: MemoryRecallUsageEvent): Promise<void>;
|
|
43
94
|
listRecallUsage?(filter?: MemoryRecallUsageFilter): Promise<MemoryRecallUsageEvent[]>;
|
|
95
|
+
applyRecallReward?(input: MemoryRecallRewardInput): Promise<MemoryRecallRewardResult>;
|
|
96
|
+
listMemoryValueLog?(filter?: MemoryValueLogFilter): Promise<MemoryValueLogEntry[]>;
|
|
44
97
|
compactMaintenance?(options?: MemoryCompactOptions): Promise<MemoryCompactResult>;
|
|
45
98
|
list(filter: MemoryListFilter): Promise<MemoryRecord[]>;
|
|
46
99
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { CouncilVerdict } from '../council/types';
|
|
2
|
+
import { type MemoryConfig } from './config';
|
|
3
|
+
import type { MemoryRecallRewardInput, MemoryRecallRewardResult, MemoryTaskOutcome } from './provider';
|
|
4
|
+
export declare function councilVerdictToMemoryOutcome(verdict: CouncilVerdict): MemoryTaskOutcome;
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the set of session/run ids whose recall-usage bundles should
|
|
7
|
+
* receive a council-verdict reward, deduplicated and order-preserving.
|
|
8
|
+
*
|
|
9
|
+
* `trustedSessionIds` are host/runtime-derived (e.g. `ctx.sessionID`) and are
|
|
10
|
+
* always included when present — they cannot be spoofed by tool-call
|
|
11
|
+
* arguments. `untrustedSessionIds` are caller-supplied strings (e.g. a
|
|
12
|
+
* `provenanceSessionId` arg or a per-verdict `sessionId` reported by the
|
|
13
|
+
* architect) and are included ONLY when `isKnownSession` returns true — an
|
|
14
|
+
* arbitrary, made-up string is silently dropped rather than trusted as a
|
|
15
|
+
* reward-targeting key.
|
|
16
|
+
*
|
|
17
|
+
* Important scope limitation: `isKnownSession` (backed by `getAgentSession`)
|
|
18
|
+
* proves only that the id belongs to SOME currently-tracked session
|
|
19
|
+
* process-wide — it does NOT prove that session actually participated in
|
|
20
|
+
* THIS council review. There is no swarmId/taskId cross-check available on
|
|
21
|
+
* `AgentSessionState` today, so a hallucinated or copied session id that
|
|
22
|
+
* happens to match a real, unrelated, concurrently-running session's id
|
|
23
|
+
* would still be accepted here. The blast radius is bounded to Q-value
|
|
24
|
+
* corruption of that other session's recalled memories (not privilege
|
|
25
|
+
* escalation or data exfiltration), but this is a real residual gap, not a
|
|
26
|
+
* complete fix — closing it fully requires a session→task ownership
|
|
27
|
+
* registry that does not exist in this codebase yet.
|
|
28
|
+
*
|
|
29
|
+
* A bare swarm identifier is never a valid session id substitute and must
|
|
30
|
+
* never be passed into either list.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveRewardRunIds(input: {
|
|
33
|
+
trustedSessionIds: Array<string | undefined>;
|
|
34
|
+
untrustedSessionIds: Array<string | undefined>;
|
|
35
|
+
isKnownSession: (sessionId: string) => boolean;
|
|
36
|
+
}): string[];
|
|
37
|
+
export declare function applyRecallRewardForCouncil(directory: string, configInput: Partial<MemoryConfig> | undefined, input: Omit<MemoryRecallRewardInput, 'outcome'> & {
|
|
38
|
+
verdict: CouncilVerdict;
|
|
39
|
+
}): Promise<MemoryRecallRewardResult>;
|
package/dist/memory/schema.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export declare const MemoryRecordSchema: z.ZodObject<{
|
|
|
120
120
|
updatedAt: z.ZodString;
|
|
121
121
|
lastAccessedAt: z.ZodOptional<z.ZodString>;
|
|
122
122
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
123
|
+
qValue: z.ZodOptional<z.ZodNumber>;
|
|
123
124
|
supersedes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
124
125
|
supersededBy: z.ZodOptional<z.ZodString>;
|
|
125
126
|
contentHash: z.ZodString;
|
|
@@ -198,6 +199,7 @@ export declare const MemoryProposalSchema: z.ZodObject<{
|
|
|
198
199
|
updatedAt: z.ZodString;
|
|
199
200
|
lastAccessedAt: z.ZodOptional<z.ZodString>;
|
|
200
201
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
202
|
+
qValue: z.ZodOptional<z.ZodNumber>;
|
|
201
203
|
supersedes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
204
|
supersededBy: z.ZodOptional<z.ZodString>;
|
|
203
205
|
contentHash: z.ZodString;
|
package/dist/memory/scoring.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare const SCORING_WEIGHTS: {
|
|
|
26
26
|
readonly roleBoost: 0.05;
|
|
27
27
|
readonly confidence: 0.08;
|
|
28
28
|
};
|
|
29
|
+
export declare const DEFAULT_MEMORY_Q_VALUE = 0.5;
|
|
29
30
|
export declare function tokenize(text: string): Set<string>;
|
|
30
31
|
/**
|
|
31
32
|
* True Jaccard similarity |A∩B| / |A∪B| over two token sets. Distinct from the
|
|
@@ -74,6 +75,7 @@ export declare function importanceScore(input: {
|
|
|
74
75
|
export declare function sameScope(a: MemoryScopeRef, b: MemoryScopeRef): boolean;
|
|
75
76
|
export declare function scopeAllowed(recordScope: MemoryScopeRef, allowedScopes: MemoryScopeRef[]): boolean;
|
|
76
77
|
export declare function scoreMemoryRecord(record: MemoryRecord, request: RecallRequest): RecallResultItem | null;
|
|
78
|
+
export declare function memoryQValue(record: MemoryRecord): number;
|
|
77
79
|
export declare function scoreMemoryRecords(records: MemoryRecord[], request: RecallRequest): RecallResultItem[];
|
|
78
80
|
export declare function scoreMemoryRecordsWithDiagnostics(records: MemoryRecord[], request: RecallRequest): {
|
|
79
81
|
items: RecallResultItem[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type MemoryConfig } from './config';
|
|
2
|
+
import type { EmbeddingProvider } from './embeddings/types';
|
|
2
3
|
import { type JsonlMigrationReport } from './jsonl-migration';
|
|
3
|
-
import type { MemoryCompactOptions, MemoryCompactResult, MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent, MemoryRecallUsageFilter } from './provider';
|
|
4
|
+
import type { MemoryCompactOptions, MemoryCompactResult, MemoryProposalStore, MemoryProvider, MemoryRecallRewardInput, MemoryRecallRewardResult, MemoryRecallUsageEvent, MemoryRecallUsageFilter, MemoryValueLogEntry, MemoryValueLogFilter } from './provider';
|
|
4
5
|
import type { RecallScoringDiagnostics } from './scoring';
|
|
5
6
|
import type { AppliedMemoryChange, MemoryListFilter, MemoryProposal, MemoryRecord, RecallRequest, RecallResultItem, ResolvedCuratorMemoryDecision } from './types';
|
|
6
7
|
interface Migration {
|
|
@@ -32,6 +33,21 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
|
|
|
32
33
|
private lastAutomaticJsonlMigration;
|
|
33
34
|
private recallCountSinceLastCompaction;
|
|
34
35
|
private isCompacting;
|
|
36
|
+
/**
|
|
37
|
+
* _internals DI seam for testing. Exposes key methods so tests can inject
|
|
38
|
+
* failures without touching the module-level mock surface.
|
|
39
|
+
*/
|
|
40
|
+
readonly _internals: {
|
|
41
|
+
writeMemory: (record: MemoryRecord) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Test-only seam: inject a fake embedding provider so propagation's
|
|
44
|
+
* cosine-similarity path can be exercised without the real
|
|
45
|
+
* `@xenova/transformers` model dependency. Must be called AFTER
|
|
46
|
+
* `initialize()` (which may otherwise construct/overwrite the real
|
|
47
|
+
* provider when `embeddings.enabled` is true).
|
|
48
|
+
*/
|
|
49
|
+
setEmbeddingProvider: (provider: EmbeddingProvider | null) => void;
|
|
50
|
+
};
|
|
35
51
|
constructor(rootDirectory: string, config?: Partial<MemoryConfig>);
|
|
36
52
|
private databasePath;
|
|
37
53
|
initialize(): Promise<void>;
|
|
@@ -46,6 +62,8 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
|
|
|
46
62
|
}>;
|
|
47
63
|
recordRecallUsage(event: MemoryRecallUsageEvent): Promise<void>;
|
|
48
64
|
listRecallUsage(filter?: MemoryRecallUsageFilter): Promise<MemoryRecallUsageEvent[]>;
|
|
65
|
+
applyRecallReward(input: MemoryRecallRewardInput): Promise<MemoryRecallRewardResult>;
|
|
66
|
+
listMemoryValueLog(filter?: MemoryValueLogFilter): Promise<MemoryValueLogEntry[]>;
|
|
49
67
|
list(filter?: MemoryListFilter): Promise<MemoryRecord[]>;
|
|
50
68
|
createProposal(proposal: MemoryProposal): Promise<MemoryProposal>;
|
|
51
69
|
listProposals(filter?: {
|
|
@@ -73,6 +91,40 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
|
|
|
73
91
|
proposals: number;
|
|
74
92
|
}>;
|
|
75
93
|
compactMaintenance(options?: MemoryCompactOptions): Promise<MemoryCompactResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Find, across the given candidate session/run ids, the most recent
|
|
96
|
+
* recall-usage bundle for EACH distinct matching id (exact match only —
|
|
97
|
+
* no unscoped time-window fallback, which would risk rewarding an
|
|
98
|
+
* unrelated task/session's recall bundle). Every distinct matched runId
|
|
99
|
+
* contributes its own latest bundle, so a council review informed by
|
|
100
|
+
* several sessions (e.g. dispatched council-member sub-agents) rewards
|
|
101
|
+
* all of their recalls, not just one.
|
|
102
|
+
*/
|
|
103
|
+
private matchingRecallUsageRows;
|
|
104
|
+
private updateMemoryQValue;
|
|
105
|
+
/**
|
|
106
|
+
* Select soft-propagation targets among recently-recalled, same-scope
|
|
107
|
+
* memories via two independent qualifying paths (issue #1467 O-004):
|
|
108
|
+
* lexical token-overlap (Jaccard, gated additionally on same `kind`), OR
|
|
109
|
+
* embedding cosine similarity when `embeddings.enabled` and a provider is
|
|
110
|
+
* available (not gated on `kind` — semantic similarity can legitimately
|
|
111
|
+
* cross kinds). A candidate qualifies if EITHER path clears its
|
|
112
|
+
* threshold; the higher of the two scores is used for fanout-cap
|
|
113
|
+
* ranking. When embeddings are disabled (the default), this reduces to
|
|
114
|
+
* the original token-overlap-only behavior with no extra cost.
|
|
115
|
+
*/
|
|
116
|
+
private findPropagationTargets;
|
|
117
|
+
/**
|
|
118
|
+
* Embed `text` (cache-first, same pattern as the recall-time query
|
|
119
|
+
* embedding lookup) for use in propagation's cosine-similarity path.
|
|
120
|
+
* Returns null on any embedding failure or when no provider is
|
|
121
|
+
* configured — callers must treat that as "no cosine signal available"
|
|
122
|
+
* and fall back to the token-overlap path rather than throwing, since
|
|
123
|
+
* this is a best-effort enhancement to an already-approximate feature.
|
|
124
|
+
*/
|
|
125
|
+
private getCachedEmbeddingForPropagation;
|
|
126
|
+
private recentlyRecalledMemoryIds;
|
|
127
|
+
private listRecallUsageSync;
|
|
76
128
|
hasMigration(name: string): boolean;
|
|
77
129
|
markMigration(version: number, name: string): void;
|
|
78
130
|
private selectRecallCandidates;
|
package/dist/memory/types.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export interface MemoryRecord {
|
|
|
31
31
|
updatedAt: string;
|
|
32
32
|
lastAccessedAt?: string;
|
|
33
33
|
expiresAt?: string;
|
|
34
|
+
qValue?: number;
|
|
34
35
|
supersedes?: string[];
|
|
35
36
|
supersededBy?: string;
|
|
36
37
|
contentHash: string;
|
|
@@ -142,6 +143,9 @@ export interface RecallRequest {
|
|
|
142
143
|
maxItems: number;
|
|
143
144
|
tokenBudget: number;
|
|
144
145
|
minScore?: number;
|
|
146
|
+
qValueBoostWeight?: number;
|
|
147
|
+
suppressionThreshold?: number;
|
|
148
|
+
includeLowQ?: boolean;
|
|
145
149
|
requireQuerySignal?: boolean;
|
|
146
150
|
includeExpired?: boolean;
|
|
147
151
|
includePendingProposals?: boolean;
|
|
@@ -155,6 +159,7 @@ export interface RecallResultItem {
|
|
|
155
159
|
tagOverlap: number;
|
|
156
160
|
fileOverlap?: number;
|
|
157
161
|
symbolOverlap?: number;
|
|
162
|
+
qValue?: number;
|
|
158
163
|
kindMatch: boolean;
|
|
159
164
|
scopeMatch: boolean;
|
|
160
165
|
};
|
|
@@ -49,7 +49,9 @@ export declare const ArgsSchema: z.ZodObject<{
|
|
|
49
49
|
criteriaAssessed: z.ZodArray<z.ZodString>;
|
|
50
50
|
criteriaUnmet: z.ZodArray<z.ZodString>;
|
|
51
51
|
durationMs: z.ZodNumber;
|
|
52
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
52
53
|
}, z.core.$strip>>;
|
|
53
54
|
working_directory: z.ZodOptional<z.ZodString>;
|
|
55
|
+
provenanceSessionId: z.ZodOptional<z.ZodString>;
|
|
54
56
|
}, z.core.$strip>;
|
|
55
57
|
export declare const submit_council_verdicts: ReturnType<typeof tool>;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* used by both the builder and the incremental updater.
|
|
12
12
|
*/
|
|
13
13
|
import { extractFileSymbols } from '../../lang/symbol-graph';
|
|
14
|
-
import { extractPythonSymbols, extractTSSymbols } from '../symbols';
|
|
14
|
+
import { extractGoSymbols, extractPythonSymbols, extractRustSymbols, extractTSSymbols } from '../symbols';
|
|
15
15
|
import { extractFileOntology } from './ontology';
|
|
16
16
|
import { safeRealpathSync } from './safe-realpath';
|
|
17
17
|
import type { BuildWorkspaceGraphOptions, GraphEdge, GraphNode, RepoGraph, RepoGraphDiagnostics, SymbolEdge } from './types';
|
|
@@ -25,6 +25,8 @@ export declare const _internals: {
|
|
|
25
25
|
safeRealpathSync: typeof safeRealpathSync;
|
|
26
26
|
extractTSSymbols: typeof extractTSSymbols;
|
|
27
27
|
extractPythonSymbols: typeof extractPythonSymbols;
|
|
28
|
+
extractRustSymbols: typeof extractRustSymbols;
|
|
29
|
+
extractGoSymbols: typeof extractGoSymbols;
|
|
28
30
|
parseFileImports: typeof parseFileImports;
|
|
29
31
|
extractFileOntology: typeof extractFileOntology;
|
|
30
32
|
stripComments: typeof stripComments;
|
|
@@ -108,7 +110,7 @@ interface ParsedImport {
|
|
|
108
110
|
* character (REGEX_ALLOWED_AFTER).
|
|
109
111
|
*/
|
|
110
112
|
declare function stripComments(content: string): string;
|
|
111
|
-
declare function parseFileImports(rawContent: string): ParsedImport[];
|
|
113
|
+
declare function parseFileImports(rawContent: string, sourceFile?: string, workspaceRoot?: string): ParsedImport[];
|
|
112
114
|
/**
|
|
113
115
|
* Conservatively determine which imported bindings are actually referenced in
|
|
114
116
|
* the importing file's body.
|
|
@@ -35,6 +35,7 @@ export declare const ArgsSchema: z.ZodObject<{
|
|
|
35
35
|
criteriaAssessed: z.ZodArray<z.ZodString>;
|
|
36
36
|
criteriaUnmet: z.ZodArray<z.ZodString>;
|
|
37
37
|
durationMs: z.ZodNumber;
|
|
38
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
38
39
|
}, z.core.$strip>>;
|
|
39
40
|
working_directory: z.ZodOptional<z.ZodString>;
|
|
40
41
|
provenanceAgentName: z.ZodOptional<z.ZodString>;
|
package/dist/tools/symbols.d.ts
CHANGED
|
@@ -17,5 +17,7 @@ export declare function extractTSSymbols(filePath: string, cwd: string): SymbolI
|
|
|
17
17
|
* Extract symbols from a Python file.
|
|
18
18
|
*/
|
|
19
19
|
export declare function extractPythonSymbols(filePath: string, cwd: string): SymbolInfo[];
|
|
20
|
+
export declare function extractRustSymbols(filePath: string, cwd: string): SymbolInfo[];
|
|
21
|
+
export declare function extractGoSymbols(filePath: string, cwd: string): SymbolInfo[];
|
|
20
22
|
export declare const symbols: ToolDefinition;
|
|
21
23
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.105.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",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
".opencode/skills/design-docs",
|
|
56
56
|
".opencode/skills/swarm-pr-review",
|
|
57
57
|
".opencode/skills/swarm-pr-feedback",
|
|
58
|
+
".opencode/skills/swarm-pr-subscribe",
|
|
58
59
|
".opencode/skills/issue-ingest",
|
|
59
60
|
".opencode/skills/plan",
|
|
60
61
|
".opencode/skills/critic-gate",
|