@remnic/core 10.0.5 → 10.0.6

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 (75) hide show
  1. package/dist/access-admin-ops-surface.js +5 -5
  2. package/dist/access-authorization-probe.js +6 -6
  3. package/dist/access-boundary.js +5 -5
  4. package/dist/access-cli.js +21 -21
  5. package/dist/access-extraction-force-flush.js +5 -5
  6. package/dist/access-http-briefing.js +6 -6
  7. package/dist/access-http-query.js +5 -5
  8. package/dist/access-http.js +17 -17
  9. package/dist/access-identity-continuity-surface.js +5 -5
  10. package/dist/access-lcm-surface.js +5 -5
  11. package/dist/access-mcp.js +12 -12
  12. package/dist/access-namespace-preflight.js +5 -5
  13. package/dist/access-observe-write-surface.js +5 -5
  14. package/dist/access-operations-batch.js +6 -6
  15. package/dist/access-operations.js +11 -11
  16. package/dist/access-recall-concurrency.js +5 -5
  17. package/dist/access-recall-response.js +5 -5
  18. package/dist/access-recall-surface.js +5 -5
  19. package/dist/access-service.js +5 -5
  20. package/dist/access-surface-catalog.js +7 -7
  21. package/dist/calibration.d.ts +31 -3
  22. package/dist/calibration.d.ts.map +1 -1
  23. package/dist/calibration.js +67 -16
  24. package/dist/calibration.js.map +1 -1
  25. package/dist/{chunk-WRICYGYG.js → chunk-2UF42WXV.js} +8 -8
  26. package/dist/{chunk-5LNPW7NE.js → chunk-4JNTGPBR.js} +2 -2
  27. package/dist/{chunk-SUAX5JWY.js → chunk-6C76FZRM.js} +2 -2
  28. package/dist/{chunk-HPAOMYKM.js → chunk-7CZIKCJR.js} +8 -8
  29. package/dist/{chunk-4CWUZBPF.js → chunk-CCMXCZLT.js} +3 -3
  30. package/dist/{chunk-NBQIFCJE.js → chunk-D6M3VKMY.js} +3 -9
  31. package/dist/chunk-D6M3VKMY.js.map +1 -0
  32. package/dist/{chunk-GVUW5XK5.js → chunk-DTXN4NVD.js} +4 -4
  33. package/dist/{chunk-5CQO6LVM.js → chunk-KCCZFDJD.js} +2 -2
  34. package/dist/{chunk-I25RINZK.js → chunk-KQT4DRKF.js} +2 -2
  35. package/dist/{chunk-AXC7UTLM.js → chunk-MH2DXDN6.js} +2 -2
  36. package/dist/{chunk-FRH2UC7Q.js → chunk-Q562GF7J.js} +2 -2
  37. package/dist/{chunk-NHSVW7UT.js → chunk-QEPL7KIZ.js} +2 -2
  38. package/dist/{chunk-5BY3IA2U.js → chunk-QGLEM46C.js} +2 -2
  39. package/dist/{chunk-V32NHP2R.js → chunk-TL4PM7PC.js} +2 -2
  40. package/dist/{chunk-52CQKST6.js → chunk-TRBLJU6Y.js} +4 -4
  41. package/dist/{chunk-M47Q6566.js → chunk-VUEG3TZ4.js} +2 -2
  42. package/dist/{chunk-DST7HRSG.js → chunk-YGPXV546.js} +2 -2
  43. package/dist/cli.js +18 -18
  44. package/dist/compounding/engine.d.ts.map +1 -1
  45. package/dist/compounding/engine.js +1 -1
  46. package/dist/external-wiki-access.js +6 -6
  47. package/dist/extraction.js +4 -4
  48. package/dist/index.js +21 -21
  49. package/dist/memory-browse-operations.js +6 -6
  50. package/dist/orchestration/maintenance.js +2 -2
  51. package/dist/orchestrator.js +21 -21
  52. package/dist/recall-navigation-operations.js +6 -6
  53. package/dist/recall-navigation.js +5 -5
  54. package/dist/support-passport/index.js +8 -8
  55. package/package.json +2 -2
  56. package/src/calibration-local-llm.test.ts +361 -0
  57. package/src/calibration.ts +109 -26
  58. package/src/compounding/engine.ts +2 -8
  59. package/dist/chunk-NBQIFCJE.js.map +0 -1
  60. /package/dist/{chunk-WRICYGYG.js.map → chunk-2UF42WXV.js.map} +0 -0
  61. /package/dist/{chunk-5LNPW7NE.js.map → chunk-4JNTGPBR.js.map} +0 -0
  62. /package/dist/{chunk-SUAX5JWY.js.map → chunk-6C76FZRM.js.map} +0 -0
  63. /package/dist/{chunk-HPAOMYKM.js.map → chunk-7CZIKCJR.js.map} +0 -0
  64. /package/dist/{chunk-4CWUZBPF.js.map → chunk-CCMXCZLT.js.map} +0 -0
  65. /package/dist/{chunk-GVUW5XK5.js.map → chunk-DTXN4NVD.js.map} +0 -0
  66. /package/dist/{chunk-5CQO6LVM.js.map → chunk-KCCZFDJD.js.map} +0 -0
  67. /package/dist/{chunk-I25RINZK.js.map → chunk-KQT4DRKF.js.map} +0 -0
  68. /package/dist/{chunk-AXC7UTLM.js.map → chunk-MH2DXDN6.js.map} +0 -0
  69. /package/dist/{chunk-FRH2UC7Q.js.map → chunk-Q562GF7J.js.map} +0 -0
  70. /package/dist/{chunk-NHSVW7UT.js.map → chunk-QEPL7KIZ.js.map} +0 -0
  71. /package/dist/{chunk-5BY3IA2U.js.map → chunk-QGLEM46C.js.map} +0 -0
  72. /package/dist/{chunk-V32NHP2R.js.map → chunk-TL4PM7PC.js.map} +0 -0
  73. /package/dist/{chunk-52CQKST6.js.map → chunk-TRBLJU6Y.js.map} +0 -0
  74. /package/dist/{chunk-M47Q6566.js.map → chunk-VUEG3TZ4.js.map} +0 -0
  75. /package/dist/{chunk-DST7HRSG.js.map → chunk-YGPXV546.js.map} +0 -0
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  CompoundingEngine,
34
34
  defaultTierMigrationCycleBudget
35
- } from "./chunk-NBQIFCJE.js";
35
+ } from "./chunk-D6M3VKMY.js";
36
36
  import {
37
37
  SharedContextManager
38
38
  } from "./chunk-77HNHT6S.js";
@@ -228,7 +228,7 @@ import {
228
228
  runTimelinePublishCli,
229
229
  screenCandidateFact,
230
230
  summarizeVaultPublish
231
- } from "./chunk-52CQKST6.js";
231
+ } from "./chunk-TRBLJU6Y.js";
232
232
  import {
233
233
  normalizeReplaySessionKey
234
234
  } from "./chunk-AJVLDJU6.js";
@@ -367,7 +367,7 @@ import {
367
367
  } from "./chunk-QW27DOHG.js";
368
368
  import {
369
369
  MeetingsInputError
370
- } from "./chunk-WRICYGYG.js";
370
+ } from "./chunk-2UF42WXV.js";
371
371
  import {
372
372
  WearablesInputError,
373
373
  describeErrorForOperator
@@ -394,7 +394,7 @@ import {
394
394
  detectPassiveCorrections,
395
395
  renderSessionExperiencePreview,
396
396
  scoreSessionExperienceForPrompt
397
- } from "./chunk-GVUW5XK5.js";
397
+ } from "./chunk-DTXN4NVD.js";
398
398
  import {
399
399
  importCapsule
400
400
  } from "./chunk-UK5EH7AI.js";
@@ -444,9 +444,6 @@ import {
444
444
  import {
445
445
  ModelRegistry
446
446
  } from "./chunk-5MA7ZLPD.js";
447
- import {
448
- LocalLlmClient
449
- } from "./chunk-JXSYWTFK.js";
450
447
  import {
451
448
  contentMatchesRedactionRules,
452
449
  loadRedactionRules
@@ -527,6 +524,9 @@ import {
527
524
  isTaskInitiationIntent,
528
525
  planRecallMode
529
526
  } from "./chunk-CSAKJVXW.js";
527
+ import {
528
+ LocalLlmClient
529
+ } from "./chunk-JXSYWTFK.js";
530
530
  import {
531
531
  decideLifecycleTransition,
532
532
  resolveLifecycleState
@@ -31096,4 +31096,4 @@ export {
31096
31096
  qmdStartupCollectionChecksWithTimeout,
31097
31097
  Orchestrator
31098
31098
  };
31099
- //# sourceMappingURL=chunk-HPAOMYKM.js.map
31099
+ //# sourceMappingURL=chunk-7CZIKCJR.js.map
@@ -12,13 +12,13 @@ import {
12
12
  } from "./chunk-DJMVSUPK.js";
13
13
  import {
14
14
  externalWikiSearchOperation
15
- } from "./chunk-I25RINZK.js";
15
+ } from "./chunk-KQT4DRKF.js";
16
16
  import {
17
17
  DECISION_SUBCOMMANDS,
18
18
  DELTA_SUBCOMMANDS,
19
19
  defineOperation,
20
20
  isCodegraphToolName
21
- } from "./chunk-GVUW5XK5.js";
21
+ } from "./chunk-DTXN4NVD.js";
22
22
  import {
23
23
  CorrectionContractError
24
24
  } from "./chunk-ETSJD5IV.js";
@@ -1916,4 +1916,4 @@ export {
1916
1916
  codegraphIngestTracesOperation,
1917
1917
  REGISTERED_OPERATIONS
1918
1918
  };
1919
- //# sourceMappingURL=chunk-4CWUZBPF.js.map
1919
+ //# sourceMappingURL=chunk-CCMXCZLT.js.map
@@ -307,14 +307,8 @@ var CompoundingEngine = class {
307
307
  }
308
308
  if (resolveConsolidationCapabilities(this.config).calibration) {
309
309
  try {
310
- const { runCalibrationConsolidation } = await import("./calibration.js");
311
- const calRules = await runCalibrationConsolidation({
312
- memoryDir: this.config.memoryDir,
313
- gatewayConfig: this.config.gatewayConfig,
314
- gatewayAgentId: this.config.modelSource === "gateway" ? this.config.gatewayAgentId || void 0 : void 0,
315
- modelChain: this.config.modelSource === "gateway" ? this.config.taskModelChain : void 0,
316
- workspaceDir: this.config.workspaceDir
317
- });
310
+ const { calibrationConsolidationInput, runCalibrationConsolidation } = await import("./calibration.js");
311
+ const calRules = await runCalibrationConsolidation(calibrationConsolidationInput(this.config));
318
312
  log.debug(`[calibration] weekly synthesis produced ${calRules.length} calibration rule(s)`);
319
313
  } catch (error) {
320
314
  log.warn(`[calibration] weekly consolidation failed (non-fatal): ${error instanceof Error ? error.message : String(error)}`);
@@ -1283,4 +1277,4 @@ export {
1283
1277
  defaultTierMigrationCycleBudget,
1284
1278
  CompoundingEngine
1285
1279
  };
1286
- //# sourceMappingURL=chunk-NBQIFCJE.js.map
1280
+ //# sourceMappingURL=chunk-D6M3VKMY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/compounding/engine.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, readdir, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { log } from \"../logger.js\";\nimport { composeSalvagedEnvelope } from \"../salvage-envelope.js\";\nimport { sanitizeMemoryContent } from \"../sanitize.js\";\nimport { StorageManager } from \"../storage.js\";\nimport type { ContinuityIncidentRecord, PluginConfig } from \"../types.js\";\nimport { resolveSharedContextDir, SharedFeedbackEntrySchema, type SharedFeedbackEntry } from \"../shared-context/manager.js\";\nimport { parseContinuityImprovementLoops } from \"../identity-continuity.js\";\nimport { resolveQmdCapabilities, type QmdConfigProjection, resolveConsolidationCapabilities } from \"../capabilities.js\";\nimport { resolveConversationContextCapabilities } from \"../capabilities.js\";\n\ntype MistakesFile = {\n version?: number;\n updatedAt: string;\n patterns: string[];\n registry?: MistakeRegistryEntry[];\n};\n\ntype FeedbackEntryWithProvenance = {\n entry: SharedFeedbackEntry;\n sourceLine: number;\n sourcePath: string;\n entryId: string;\n};\n\ntype PatternWithProvenance = {\n pattern: string;\n provenance: string[];\n};\n\ntype ActionOutcomeCounts = {\n applied: number;\n skipped: number;\n failed: number;\n};\n\ntype ActionOutcomeSummary = {\n action: string;\n counts: ActionOutcomeCounts;\n total: number;\n weightedScore: number;\n provenance: string[];\n};\n\ntype PromotionCandidate = {\n id: string;\n sourceType: \"action-outcome\" | \"mistake-pattern\" | \"rubric\" | \"causal-pattern\";\n subject: string;\n category: \"principle\" | \"rule\" | \"preference\";\n content: string;\n score: number;\n rationale: string;\n outcome: ActionOutcomeCounts | null;\n provenance: string[];\n agent: string | null;\n workflow: string | null;\n};\n\ntype CompoundingEntrySeverity = \"low\" | \"medium\" | \"high\";\n\ntype EvidenceWindow = {\n start: string | null;\n end: string | null;\n};\n\ntype MistakeRegistryEntry = {\n id: string;\n pattern: string;\n category: \"feedback\" | \"action\";\n status: \"active\" | \"retired\";\n agent: string | null;\n workflow: string | null;\n tags: string[];\n severity: CompoundingEntrySeverity | null;\n confidence: number | null;\n outcome: string | null;\n provenance: string[];\n firstSeenAt: string;\n lastSeenAt: string;\n recurrenceCount: number;\n lastWeekId: string;\n evidenceWindow: EvidenceWindow;\n mergedFromIds?: string[];\n retiredAt?: string | null;\n};\n\ntype RubricSnapshotEntry = {\n id: string;\n kind: \"agent\" | \"workflow\";\n subject: string;\n observations: string[];\n tags: string[];\n provenance: string[];\n observationEntries?: Array<{\n note: string;\n provenance: string[];\n }>;\n updatedAt: string;\n};\n\ntype RubricSnapshot = {\n updatedAt: string;\n agents: RubricSnapshotEntry[];\n workflows: RubricSnapshotEntry[];\n};\n\ntype WeeklyCompoundingArtifact = {\n version: number;\n generatedAt: string;\n weekId: string;\n feedback: {\n count: number;\n byDecision: Record<\"approved\" | \"approved_with_feedback\" | \"rejected\", number>;\n entries: Array<{\n agent: string;\n workflow: string | null;\n decision: SharedFeedbackEntry[\"decision\"];\n reason: string;\n learning: string | null;\n outcome: string | null;\n severity: CompoundingEntrySeverity | null;\n confidence: number | null;\n tags: string[];\n provenance: string;\n evidenceWindow: EvidenceWindow;\n }>;\n };\n mistakes: {\n count: number;\n patterns: string[];\n registry: MistakeRegistryEntry[];\n };\n rubrics: RubricSnapshot;\n outcomes: ActionOutcomeSummary[];\n promotionCandidates: PromotionCandidate[];\n continuity: { monthId: string; weeklyPath: string | null; monthlyPath: string | null };\n};\n\nexport interface CompoundingPromotionReport {\n enabled: boolean;\n dryRun: boolean;\n weekId: string;\n promoted: Array<{\n id: string;\n candidateId: string;\n category: \"principle\" | \"rule\" | \"preference\";\n content: string;\n confidence: number;\n tags: string[];\n lineage: string[];\n }>;\n skipped: Array<{\n weekId: string;\n candidateId?: string;\n reason: \"disabled\" | \"weekly-artifact-missing\" | \"candidate-not-found\" | \"duplicate-guidance\";\n existingMemoryId?: string;\n }>;\n /**\n * Promotions the #1579 tombstone chokepoint downgraded to pending_review (no\n * active copy). Reported distinctly so callers never treat a blocked write as\n * a successfully promoted active memory (#1645).\n */\n tombstoneBlocked: Array<{\n id: string;\n candidateId: string;\n category: \"principle\" | \"rule\" | \"preference\";\n content: string;\n }>;\n}\n\ntype WeeklyActionEvent = {\n line: number;\n action: string;\n outcome: \"applied\" | \"skipped\" | \"failed\";\n policyDecision: \"deny\" | \"defer\" | null;\n namespace: string;\n reason: string | null;\n};\n\nconst COMPOUNDING_VERSION = 2;\nconst RETIREMENT_WINDOW_WEEKS = 8;\n\nfunction stableSlug(value: string): string {\n return value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 80) || \"item\";\n}\n\nfunction tokenizeRecallQuery(text: string): string[] {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const token of text\n .toLowerCase()\n .replace(/[^a-z0-9\\s]+/g, \" \")\n .split(/\\s+/)\n .map((part) => part.trim())\n .filter((part) => part.length >= 3)) {\n if (seen.has(token)) continue;\n seen.add(token);\n out.push(token);\n }\n return out;\n}\n\nfunction weekIdToIndex(weekId: string): number {\n const match = weekId.match(/^(\\d{4})-W(\\d{2})$/);\n if (!match) return Number.POSITIVE_INFINITY;\n const year = Number(match[1]);\n const week = Number(match[2]);\n if (!Number.isInteger(year) || !Number.isInteger(week) || week < 1 || week > 53) {\n return Number.POSITIVE_INFINITY;\n }\n const jan4 = new Date(Date.UTC(year, 0, 4));\n const jan4Day = jan4.getUTCDay() || 7;\n const isoWeekOneStart = new Date(jan4);\n isoWeekOneStart.setUTCDate(jan4.getUTCDate() - (jan4Day - 1));\n const targetWeekStart = new Date(isoWeekOneStart);\n targetWeekStart.setUTCDate(isoWeekOneStart.getUTCDate() + ((week - 1) * 7));\n return Math.floor(targetWeekStart.getTime() / (7 * 24 * 60 * 60 * 1000));\n}\n\nfunction normalizeConfidence(value: unknown): number | null {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n const clamped = Math.max(0, Math.min(1, value));\n return Number(clamped.toFixed(3));\n}\n\nfunction normalizeTags(tags: string[] | undefined): string[] {\n if (!Array.isArray(tags)) return [];\n return [...new Set(tags.map((tag) => String(tag).trim()).filter((tag) => tag.length > 0))].sort();\n}\n\nfunction normalizeEvidenceWindow(start?: string, end?: string): EvidenceWindow {\n const safeStart = typeof start === \"string\" && start.trim().length > 0 ? start : null;\n const safeEnd = typeof end === \"string\" && end.trim().length > 0 ? end : null;\n return { start: safeStart, end: safeEnd };\n}\n\nfunction mergeEvidenceWindows(current: EvidenceWindow, next: EvidenceWindow): EvidenceWindow {\n return {\n start: current.start === null ? next.start : next.start === null ? current.start : current.start <= next.start ? current.start : next.start,\n end: current.end === null ? next.end : next.end === null ? current.end : current.end >= next.end ? current.end : next.end,\n };\n}\n\nfunction stableMistakeId(\n category: \"feedback\" | \"action\",\n pattern: string,\n agent: string | null,\n workflow: string | null,\n): string {\n return [\n category,\n agent ? stableSlug(agent) : \"global\",\n workflow ? stableSlug(workflow) : \"default\",\n stableSlug(pattern).slice(0, 48),\n ].join(\":\");\n}\n\nfunction stableRubricId(kind: \"agent\" | \"workflow\", subject: string): string {\n return `${kind}:${stableSlug(subject)}`;\n}\n\nfunction stablePromotionCandidateId(\n sourceType: PromotionCandidate[\"sourceType\"],\n subject: string,\n content: string,\n): string {\n const digest = createHash(\"sha256\")\n .update(`${sourceType}\\u0000${subject}\\u0000${content}`)\n .digest(\"hex\")\n .slice(0, 12);\n return `${sourceType}:${digest}`;\n}\n\nfunction rubricArtifactFileName(\n entry: Pick<RubricSnapshotEntry, \"kind\" | \"subject\">,\n slugCollisions: ReadonlyMap<string, number>,\n): string {\n const slug = stableSlug(entry.subject);\n if ((slugCollisions.get(slug) ?? 0) <= 1) return `${slug}.md`;\n const suffix = createHash(\"sha256\").update(`${entry.kind}:${entry.subject}`).digest(\"hex\").slice(0, 8);\n return `${slug}-${suffix}.md`;\n}\n\nfunction inferLegacyMistakeScope(pattern: string): { agent: string | null; workflow: string | null } {\n const separatorIndex = pattern.indexOf(\":\");\n if (separatorIndex <= 0) return { agent: null, workflow: null };\n const subject = pattern.slice(0, separatorIndex).trim();\n return {\n agent: subject.length > 0 ? subject : null,\n workflow: null,\n };\n}\n\nfunction inferLegacyMistakeMetadata(pattern: string): {\n category: \"feedback\" | \"action\";\n agent: string | null;\n workflow: string | null;\n} {\n if (pattern.startsWith(\"memory-action/\")) {\n return {\n category: \"action\",\n agent: null,\n workflow: \"memory-actions\",\n };\n }\n const scope = inferLegacyMistakeScope(pattern);\n return {\n category: \"feedback\",\n agent: scope.agent,\n workflow: scope.workflow,\n };\n}\n\nfunction normalizePromotionWhitespace(value: string): string {\n return value.replace(/\\s+/g, \" \").trim();\n}\n\nfunction stripTrailingPromotionPunctuation(value: string): string {\n // Linear trailing-punctuation strip (no `/[,:;]+$/` — CodeQL flags that as a\n // polynomial-backtracking ReDoS on long runs of ',;:'). Walk back once, O(n).\n let end = value.length;\n while (end > 0) {\n const ch = value[end - 1];\n if (ch === \",\" || ch === \":\" || ch === \";\") end--;\n else break;\n }\n return value.slice(0, end).trim();\n}\n\nfunction extractExplicitIfThenRule(value: string): string | null {\n const normalized = normalizePromotionWhitespace(value);\n const match = normalized.match(/^if\\b([\\s\\S]+?)\\bthen\\b([\\s\\S]+?)(?:[.!?])?$/i);\n if (!match) return null;\n const condition = stripTrailingPromotionPunctuation(normalizePromotionWhitespace(match[1] ?? \"\"));\n const outcome = stripTrailingPromotionPunctuation(normalizePromotionWhitespace(match[2] ?? \"\"));\n if (condition.length === 0 || outcome.length === 0) return null;\n return `IF ${condition} THEN ${outcome}.`;\n}\n\nfunction normalizePromotedGuidanceContent(value: string): string {\n const explicitRule = extractExplicitIfThenRule(value);\n if (explicitRule) return explicitRule;\n const normalized = normalizePromotionWhitespace(value);\n if (normalized.length === 0) return normalized;\n return /[.!?]$/.test(normalized) ? normalized : `${normalized}.`;\n}\n\nfunction canonicalPromotionContentKey(value: string): string {\n return normalizePromotedGuidanceContent(value).toLowerCase();\n}\n\nfunction lessonContentFromPattern(pattern: string, agent: string | null): string {\n if (!agent) return normalizePromotionWhitespace(pattern);\n const prefix = `${agent}:`;\n if (!pattern.startsWith(prefix)) return normalizePromotionWhitespace(pattern);\n const withoutPrefix = pattern.slice(prefix.length).trim();\n return withoutPrefix.length > 0 ? normalizePromotionWhitespace(withoutPrefix) : normalizePromotionWhitespace(pattern);\n}\n\nfunction promotionCategoryForContent(content: string): \"principle\" | \"rule\" {\n return extractExplicitIfThenRule(content) ? \"rule\" : \"principle\";\n}\n\nfunction clampPromotionScore(value: number): number {\n if (!Number.isFinite(value)) return 0.65;\n return Number(Math.max(0.65, Math.min(0.98, value)).toFixed(3));\n}\n\nexport type TierMigrationCycleTrigger = \"extraction\" | \"maintenance\";\nexport interface TierMigrationCycleBudget {\n limit: number;\n scanLimit: number;\n minIntervalMs: number;\n}\n\nexport function defaultTierMigrationCycleBudget(\n config: QmdConfigProjection,\n trigger: TierMigrationCycleTrigger,\n): TierMigrationCycleBudget {\n if (trigger === \"extraction\") {\n const limit = 12;\n return {\n limit,\n scanLimit: limit * 4,\n minIntervalMs: 60_000,\n };\n }\n const limit = resolveQmdCapabilities(config).qmdTierAutoBackfill ? 200 : 50;\n return {\n limit,\n scanLimit: limit * 4,\n minIntervalMs: resolveQmdCapabilities(config).qmdTierAutoBackfill ? 120_000 : 300_000,\n };\n}\n\nfunction isoWeekId(d: Date): string {\n // ISO week based on Thursday\n const dt = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));\n const day = dt.getUTCDay() || 7;\n dt.setUTCDate(dt.getUTCDate() + 4 - day);\n const yearStart = new Date(Date.UTC(dt.getUTCFullYear(), 0, 1));\n const week = Math.ceil((((dt.getTime() - yearStart.getTime()) / 86400000) + 1) / 7);\n const yyyy = dt.getUTCFullYear();\n return `${yyyy}-W${String(week).padStart(2, \"0\")}`;\n}\n\nfunction isoMonthId(d: Date): string {\n return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, \"0\")}`;\n}\n\nfunction monthIdFromIsoWeek(weekId: string): string {\n const match = weekId.match(/^(\\d{4})-W(\\d{2})$/);\n if (!match) return isoMonthId(new Date());\n const year = Number(match[1]);\n const week = Number(match[2]);\n const jan4 = new Date(Date.UTC(year, 0, 4));\n const jan4Day = jan4.getUTCDay() || 7;\n const isoWeekOneMonday = new Date(jan4);\n isoWeekOneMonday.setUTCDate(jan4.getUTCDate() - (jan4Day - 1));\n const monday = new Date(isoWeekOneMonday);\n monday.setUTCDate(isoWeekOneMonday.getUTCDate() + (week - 1) * 7);\n return isoMonthId(monday);\n}\n\nfunction cadenceStaleWindowMs(cadence: \"daily\" | \"weekly\" | \"monthly\" | \"quarterly\"): number {\n switch (cadence) {\n case \"daily\":\n return 2 * 24 * 60 * 60 * 1000;\n case \"weekly\":\n return 10 * 24 * 60 * 60 * 1000;\n case \"monthly\":\n return 45 * 24 * 60 * 60 * 1000;\n case \"quarterly\":\n return 120 * 24 * 60 * 60 * 1000;\n default:\n return 45 * 24 * 60 * 60 * 1000;\n }\n}\n\nexport class CompoundingEngine {\n private readonly weeklyDir: string;\n private readonly rubricsDir: string;\n private readonly rubricsIndexPath: string;\n private readonly rubricsAgentsDir: string;\n private readonly rubricsWorkflowsDir: string;\n private readonly rubricsPath: string;\n private readonly mistakesPath: string;\n private readonly feedbackInboxPath: string;\n private readonly identityAuditWeeklyDir: string;\n private readonly identityAuditMonthlyDir: string;\n private readonly memoryActionEventsPath: string;\n\n constructor(\n private readonly config: PluginConfig,\n private readonly storage: StorageManager = new StorageManager(config.memoryDir),\n ) {\n this.weeklyDir = path.join(config.memoryDir, \"compounding\", \"weekly\");\n this.rubricsDir = path.join(config.memoryDir, \"compounding\", \"rubrics\");\n this.rubricsIndexPath = path.join(this.rubricsDir, \"index.json\");\n this.rubricsAgentsDir = path.join(this.rubricsDir, \"agents\");\n this.rubricsWorkflowsDir = path.join(this.rubricsDir, \"workflows\");\n this.rubricsPath = path.join(config.memoryDir, \"compounding\", \"rubrics.md\");\n this.mistakesPath = path.join(config.memoryDir, \"compounding\", \"mistakes.json\");\n this.feedbackInboxPath = path.join(resolveSharedContextDir(config), \"feedback\", \"inbox.jsonl\");\n this.identityAuditWeeklyDir = path.join(config.memoryDir, \"identity\", \"audits\", \"weekly\");\n this.identityAuditMonthlyDir = path.join(config.memoryDir, \"identity\", \"audits\", \"monthly\");\n this.memoryActionEventsPath = path.join(config.memoryDir, \"state\", \"memory-actions.jsonl\");\n }\n\n async ensureDirs(): Promise<void> {\n await mkdir(this.weeklyDir, { recursive: true });\n await mkdir(path.dirname(this.mistakesPath), { recursive: true });\n await mkdir(path.dirname(this.rubricsPath), { recursive: true });\n await mkdir(this.rubricsDir, { recursive: true });\n await mkdir(this.rubricsAgentsDir, { recursive: true });\n await mkdir(this.rubricsWorkflowsDir, { recursive: true });\n }\n\n async synthesizeWeekly(opts?: {\n weekId?: string;\n }): Promise<{\n weekId: string;\n reportPath: string;\n reportJsonPath: string;\n mistakesCount: number;\n rubricsPath: string;\n rubricsIndexPath: string;\n promotionCandidateCount: number;\n }> {\n await this.ensureDirs();\n const weekId = opts?.weekId ?? isoWeekId(new Date());\n\n const entries = await this.readFeedbackEntriesForWeek(weekId);\n const actionEvents = await this.readActionEventsForWeek(weekId);\n const actionPatterns = this.buildActionFailurePatterns(actionEvents);\n const outcomeSummary = this.buildActionOutcomeSummary(actionEvents);\n const previousMistakes = await this.readMistakes();\n const mistakes = this.buildMistakes(entries, actionPatterns, weekId, previousMistakes?.registry ?? []);\n const rubrics = this.buildRubricSnapshot(entries, outcomeSummary);\n let promotionCandidates = resolveConsolidationCapabilities(this.config).compoundingSemantic\n ? this.derivePromotionCandidates(outcomeSummary, mistakes.registry, rubrics)\n : [];\n if (resolveConversationContextCapabilities(this.config).cmcConsolidation) {\n try {\n const { deriveCausalPromotionCandidates, materializeAfterCausalConsolidation } = await import(\"../causal-consolidation.js\");\n const causalCandidates = await deriveCausalPromotionCandidates({\n memoryDir: this.config.memoryDir,\n causalTrajectoryStoreDir: this.config.causalTrajectoryStoreDir,\n gatewayConfig: this.config.gatewayConfig,\n gatewayAgentId: this.config.modelSource === \"gateway\" ? (this.config.gatewayAgentId || undefined) : undefined,\n modelChain: this.config.modelSource === \"gateway\" ? this.config.taskModelChain : undefined,\n workspaceDir: this.config.workspaceDir,\n pluginConfig: this.config,\n config: {\n minRecurrence: this.config.cmcConsolidationMinRecurrence,\n minSessions: this.config.cmcConsolidationMinSessions,\n successThreshold: this.config.cmcConsolidationSuccessThreshold,\n },\n });\n if (causalCandidates.length > 0) {\n promotionCandidates = [...promotionCandidates, ...causalCandidates];\n }\n // #378: fire the Codex materialize post-hook so\n // `codexMaterializeOnConsolidation` actually has a runtime effect\n // when the causal consolidation path runs. The helper silently no-ops\n // when the feature flag or the per-trigger toggle is off, when the\n // sentinel is missing, or when nothing has changed since the previous\n // run. Wrapped in its own try/catch so a failed materialize never\n // aborts weekly synthesis.\n try {\n await materializeAfterCausalConsolidation({\n config: this.config,\n memoryDir: this.config.memoryDir,\n });\n } catch (materializeError) {\n log.warn(\n `[cmc] Codex materialize post-hook failed (non-fatal): ${\n materializeError instanceof Error ? materializeError.message : String(materializeError)\n }`,\n );\n }\n } catch (error) {\n log.warn(`[cmc] causal consolidation in synthesizeWeekly failed (non-fatal): ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n // PEDC: Run calibration consolidation during weekly synthesis\n if (resolveConsolidationCapabilities(this.config).calibration) {\n try {\n const { calibrationConsolidationInput, runCalibrationConsolidation } = await import(\"../calibration.js\");\n const calRules = await runCalibrationConsolidation(calibrationConsolidationInput(this.config));\n log.debug(`[calibration] weekly synthesis produced ${calRules.length} calibration rule(s)`);\n } catch (error) {\n log.warn(`[calibration] weekly consolidation failed (non-fatal): ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n const continuity = resolveConsolidationCapabilities(this.config).continuityAudit\n ? await this.readContinuityAuditReferences(weekId)\n : { monthId: monthIdFromIsoWeek(weekId), weeklyPath: null, monthlyPath: null };\n\n // Write weekly report (always, even if empty: \"day-one outcomes\").\n const reportPath = path.join(this.weeklyDir, `${weekId}.md`);\n const md = this.formatWeeklyReport(weekId, entries, mistakes.patterns, mistakes.details, continuity, outcomeSummary, promotionCandidates);\n await writeFile(reportPath, md, \"utf-8\");\n\n const reportJsonPath = path.join(this.weeklyDir, `${weekId}.json`);\n const weeklyArtifact: WeeklyCompoundingArtifact = {\n version: COMPOUNDING_VERSION,\n generatedAt: mistakes.updatedAt,\n weekId,\n feedback: {\n count: entries.length,\n byDecision: {\n approved: entries.filter((wrapped) => wrapped.entry.decision === \"approved\").length,\n approved_with_feedback: entries.filter((wrapped) => wrapped.entry.decision === \"approved_with_feedback\").length,\n rejected: entries.filter((wrapped) => wrapped.entry.decision === \"rejected\").length,\n },\n entries: entries.map((wrapped) => ({\n agent: wrapped.entry.agent,\n workflow: wrapped.entry.workflow ?? null,\n decision: wrapped.entry.decision,\n reason: wrapped.entry.reason,\n learning: wrapped.entry.learning?.trim() || null,\n outcome: wrapped.entry.outcome?.trim() || null,\n severity: wrapped.entry.severity ?? null,\n confidence: normalizeConfidence(wrapped.entry.confidence),\n tags: normalizeTags(wrapped.entry.tags),\n provenance: `${path.basename(wrapped.sourcePath)}:L${wrapped.sourceLine}#${wrapped.entryId}`,\n evidenceWindow: normalizeEvidenceWindow(wrapped.entry.evidenceWindowStart, wrapped.entry.evidenceWindowEnd),\n })),\n },\n mistakes: {\n count: mistakes.patterns.length,\n patterns: mistakes.patterns,\n registry: mistakes.registry,\n },\n rubrics,\n outcomes: outcomeSummary,\n promotionCandidates,\n continuity,\n };\n await writeFile(reportJsonPath, JSON.stringify(weeklyArtifact, null, 2) + \"\\n\", \"utf-8\");\n\n // Write stable rubric artifact.\n const rubricsMarkdown = this.formatRubrics(outcomeSummary, rubrics);\n await writeFile(this.rubricsPath, rubricsMarkdown, \"utf-8\");\n await writeFile(this.rubricsIndexPath, JSON.stringify(rubrics, null, 2) + \"\\n\", \"utf-8\");\n await this.syncRubricArtifacts(rubrics);\n\n // Update mistakes.json (always).\n await writeFile(\n this.mistakesPath,\n JSON.stringify({\n version: COMPOUNDING_VERSION,\n updatedAt: mistakes.updatedAt,\n patterns: mistakes.patterns,\n registry: mistakes.registry,\n }, null, 2) + \"\\n\",\n \"utf-8\",\n );\n\n log.info(\n `compounding: wrote weekly=${reportPath} weeklyJson=${reportJsonPath} rubrics=${this.rubricsPath} rubricsIndex=${this.rubricsIndexPath} mistakes=${this.mistakesPath}`,\n );\n return {\n weekId,\n reportPath,\n reportJsonPath,\n rubricsPath: this.rubricsPath,\n rubricsIndexPath: this.rubricsIndexPath,\n mistakesCount: mistakes.patterns.length,\n promotionCandidateCount: promotionCandidates.length,\n };\n }\n\n async promoteCandidate(opts: {\n weekId: string;\n candidateId: string;\n dryRun?: boolean;\n storage?: StorageManager;\n }): Promise<CompoundingPromotionReport> {\n const report: CompoundingPromotionReport = {\n enabled: resolveConsolidationCapabilities(this.config).compounding === true && resolveConsolidationCapabilities(this.config).compoundingSemantic === true,\n dryRun: opts.dryRun === true,\n weekId: opts.weekId,\n promoted: [],\n skipped: [],\n tombstoneBlocked: [],\n };\n if (!report.enabled) {\n report.skipped.push({ weekId: opts.weekId, candidateId: opts.candidateId, reason: \"disabled\" });\n return report;\n }\n\n const artifact = await this.readWeeklyArtifact(opts.weekId);\n if (!artifact) {\n report.skipped.push({ weekId: opts.weekId, candidateId: opts.candidateId, reason: \"weekly-artifact-missing\" });\n return report;\n }\n\n const candidate = artifact.promotionCandidates.find((entry) => entry.id === opts.candidateId);\n if (!candidate) {\n report.skipped.push({ weekId: opts.weekId, candidateId: opts.candidateId, reason: \"candidate-not-found\" });\n return report;\n }\n\n const content = normalizePromotedGuidanceContent(candidate.content);\n const persistedContent = sanitizeMemoryContent(content).text;\n const storage = opts.storage ?? new StorageManager(this.config.memoryDir);\n const existing = (await storage.readAllMemories()).find((memory) =>\n memory.frontmatter.category === candidate.category &&\n memory.frontmatter.status !== \"archived\" &&\n memory.frontmatter.status !== \"forgotten\" &&\n canonicalPromotionContentKey(memory.content) === canonicalPromotionContentKey(persistedContent)\n );\n if (existing) {\n report.skipped.push({\n weekId: opts.weekId,\n candidateId: opts.candidateId,\n reason: \"duplicate-guidance\",\n existingMemoryId: existing.frontmatter.id,\n });\n return report;\n }\n\n const tags = [\n \"compounding\",\n \"compounding-promotion\",\n `compounding-source-${candidate.sourceType}`,\n ...(candidate.agent ? [`agent:${stableSlug(candidate.agent)}`] : []),\n ...(candidate.workflow ? [`workflow:${stableSlug(candidate.workflow)}`] : []),\n ];\n const uniqueTags = [...new Set(tags)];\n const lineage = [`compounding:${opts.weekId}:${opts.candidateId}`];\n const confidence = clampPromotionScore(candidate.score);\n\n if (opts.dryRun === true) {\n report.promoted.push({\n id: `dry-run:${opts.weekId}:${opts.candidateId}`,\n candidateId: opts.candidateId,\n category: candidate.category,\n content: persistedContent,\n confidence,\n tags: uniqueTags,\n lineage,\n });\n return report;\n }\n\n // Sealed-envelope write (issue #1989 PR4): synthesized machine data.\n const promotionInput = { content: persistedContent, category: candidate.category, confidence, tags: uniqueTags };\n const { id, tombstoneBlocked } = await storage.writeSealedMemory(\n composeSalvagedEnvelope(\"compounding-promotion\", promotionInput, { source: \"compounding-promotion\" }),\n { lineage, memoryKind: \"note\" },\n );\n // #1645: a tombstone-blocked promotion lands pending_review (no active\n // copy) — divert it to the tombstoneBlocked list so the report never\n // claims a blocked write as a successfully promoted active memory.\n if (tombstoneBlocked) {\n report.tombstoneBlocked.push({\n id,\n candidateId: opts.candidateId,\n category: candidate.category,\n content: persistedContent,\n });\n return report;\n }\n report.promoted.push({\n id,\n candidateId: opts.candidateId,\n category: candidate.category,\n content: persistedContent,\n confidence,\n tags: uniqueTags,\n lineage,\n });\n return report;\n }\n\n async synthesizeContinuityAudit(opts?: {\n period?: \"weekly\" | \"monthly\";\n key?: string;\n }): Promise<{ period: \"weekly\" | \"monthly\"; key: string; reportPath: string }> {\n const period = opts?.period === \"monthly\" ? \"monthly\" : \"weekly\";\n const key = opts?.key?.trim() || (period === \"weekly\" ? isoWeekId(new Date()) : isoMonthId(new Date()));\n const nowIso = new Date().toISOString();\n const [identityAnchor, improvementLoopsRaw, openIncidents, closedIncidents, mistakes] = await Promise.all([\n this.readOptionalIdentityAnchorForAudit(),\n this.readOptionalImprovementLoopsForAudit(),\n this.readContinuityIncidentsForAudit(200, \"open\"),\n this.readContinuityIncidentsForAudit(200, \"closed\"),\n this.readMistakes(),\n ]);\n const anchorPresent = (identityAnchor ?? \"\").trim().length > 0;\n const improvementLoops = improvementLoopsRaw ? parseContinuityImprovementLoops(improvementLoopsRaw) : [];\n const activeLoops = improvementLoops.filter((loop) => loop.status === \"active\");\n const staleActiveLoops = activeLoops.filter((loop) => {\n const reviewedAt = Date.parse(loop.lastReviewed);\n if (!Number.isFinite(reviewedAt)) return true;\n return Date.now() - reviewedAt > cadenceStaleWindowMs(loop.cadence);\n });\n const hardeningCandidates: string[] = [];\n if (!anchorPresent) {\n hardeningCandidates.push(\"Create/update identity anchor baseline and verify recovery injection path.\");\n }\n if (openIncidents.length > 0) {\n hardeningCandidates.push(\n `Close or downgrade ${openIncidents.length} open continuity incident${openIncidents.length === 1 ? \"\" : \"s\"}.`,\n );\n }\n if (improvementLoops.length === 0) {\n hardeningCandidates.push(\"Initialize continuity improvement-loops register with cadence and kill conditions.\");\n } else if (staleActiveLoops.length > 0) {\n hardeningCandidates.push(\n `Review stale active continuity loop${staleActiveLoops.length === 1 ? \"\" : \"s\"}: ${staleActiveLoops\n .slice(0, 3)\n .map((loop) => loop.id)\n .join(\", \")}.`,\n );\n }\n if ((mistakes?.patterns.length ?? 0) > 0) {\n hardeningCandidates.push(\"Review latest compounding mistakes and convert one pattern into preventive continuity rule.\");\n }\n const nextAction = hardeningCandidates[0] ?? \"No critical drift detected; keep weekly/monthly continuity audit cadence.\";\n\n const lines: string[] = [\n `# Continuity Audit — ${period} ${key}`,\n \"\",\n `Generated: ${nowIso}`,\n `Scope: ${period}`,\n \"\",\n \"## Signal Summary\",\n `- Identity anchor present: ${anchorPresent ? \"yes\" : \"no\"}`,\n `- Improvement loops tracked: ${improvementLoops.length}`,\n `- Active improvement loops: ${activeLoops.length}`,\n `- Stale active loops: ${staleActiveLoops.length}`,\n `- Open incidents: ${openIncidents.length}`,\n `- Closed incidents: ${closedIncidents.length}`,\n `- Compounding mistake patterns: ${mistakes?.patterns.length ?? 0}`,\n \"\",\n \"## Drift Checks\",\n `- Identity anchor drift: ${anchorPresent ? \"pass\" : \"needs attention\"}`,\n `- Incident backlog: ${openIncidents.length === 0 ? \"pass\" : \"needs attention\"}`,\n `- Improvement-loop coverage: ${improvementLoops.length > 0 ? \"pass\" : \"needs attention\"}`,\n `- Improvement-loop freshness: ${staleActiveLoops.length === 0 ? \"pass\" : \"needs attention\"}`,\n \"\",\n \"## Stale Rule Detection\",\n `- Open incidents older than closure window: ${openIncidents.length > 0 ? \"possible\" : \"none detected\"}`,\n `- Stale active continuity loops: ${staleActiveLoops.length > 0 ? staleActiveLoops.map((l) => l.id).join(\", \") : \"none detected\"}`,\n `- Preventive rule coverage on closed incidents: ${\n closedIncidents.some((i) => (i.preventiveRule ?? \"\").trim().length > 0) ? \"present\" : \"not detected\"\n }`,\n \"\",\n \"## Next Hardening Action\",\n `- ${nextAction}`,\n \"\",\n \"## Open Incident IDs\",\n ...(openIncidents.length > 0 ? openIncidents.slice(0, 20).map((i) => `- ${i.id}`) : [\"- (none)\"]),\n \"\",\n ];\n\n const reportPath = await this.storage.writeIdentityAudit(period, key, lines.join(\"\\n\"));\n return { period, key, reportPath };\n }\n\n async readMistakes(): Promise<MistakesFile | null> {\n try {\n const raw = await readFile(this.mistakesPath, \"utf-8\");\n const parsed = JSON.parse(raw) as MistakesFile;\n if (!parsed || !Array.isArray(parsed.patterns)) return null;\n if (!Array.isArray(parsed.registry)) {\n const updatedAt = typeof parsed.updatedAt === \"string\" && parsed.updatedAt.length > 0\n ? parsed.updatedAt\n : new Date(0).toISOString();\n parsed.registry = parsed.patterns.map((pattern) => {\n const metadata = inferLegacyMistakeMetadata(pattern);\n return {\n id: stableMistakeId(metadata.category, pattern, metadata.agent, metadata.workflow),\n pattern,\n category: metadata.category,\n status: \"active\",\n agent: metadata.agent,\n workflow: metadata.workflow,\n tags: [],\n severity: null,\n confidence: null,\n outcome: null,\n provenance: [],\n firstSeenAt: updatedAt,\n lastSeenAt: updatedAt,\n recurrenceCount: 1,\n lastWeekId: isoWeekId(new Date(updatedAt)),\n evidenceWindow: { start: null, end: null },\n };\n });\n }\n return parsed;\n } catch {\n return null;\n }\n }\n\n async readRubrics(): Promise<RubricSnapshot | null> {\n try {\n const raw = await readFile(this.rubricsIndexPath, \"utf-8\");\n const parsed = JSON.parse(raw) as RubricSnapshot;\n if (!parsed || !Array.isArray(parsed.agents) || !Array.isArray(parsed.workflows)) return null;\n parsed.agents = parsed.agents.map((entry) => this.normalizeRubricEntry(entry));\n parsed.workflows = parsed.workflows.map((entry) => this.normalizeRubricEntry(entry));\n return parsed;\n } catch {\n return null;\n }\n }\n\n async readWeeklyArtifact(weekId: string): Promise<WeeklyCompoundingArtifact | null> {\n try {\n const raw = await readFile(path.join(this.weeklyDir, `${weekId}.json`), \"utf-8\");\n const parsed = JSON.parse(raw) as WeeklyCompoundingArtifact;\n if (\n !parsed ||\n parsed.weekId !== weekId ||\n !Array.isArray(parsed.promotionCandidates)\n ) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n }\n\n async buildRecallSection(\n query: string,\n opts?: { maxPatterns?: number; maxRubrics?: number },\n ): Promise<string | null> {\n const [mistakes, rubrics] = await Promise.all([\n this.readMistakes(),\n this.readRubrics(),\n ]);\n const maxPatterns = Math.max(0, Math.floor(opts?.maxPatterns ?? 40));\n const maxRubrics = Math.max(0, Math.floor(opts?.maxRubrics ?? 4));\n const queryTokens = tokenizeRecallQuery(query);\n\n const activePatterns = (mistakes?.registry ?? [])\n .filter((entry) => entry.status === \"active\")\n .sort((a, b) =>\n b.recurrenceCount - a.recurrenceCount ||\n b.lastSeenAt.localeCompare(a.lastSeenAt) ||\n a.pattern.localeCompare(b.pattern),\n );\n const topPatterns = activePatterns.slice(0, maxPatterns);\n\n const allRubrics = [\n ...(rubrics?.workflows ?? []),\n ...(rubrics?.agents ?? []),\n ];\n const scoredRubrics = allRubrics\n .map((entry) => ({\n entry,\n score: this.scoreRubricForQuery(entry, queryTokens),\n }))\n .sort((a, b) =>\n b.score - a.score ||\n b.entry.observations.length - a.entry.observations.length ||\n a.entry.subject.localeCompare(b.entry.subject),\n );\n const topRubrics = scoredRubrics\n .filter((item) => item.score > 0 || queryTokens.length === 0)\n .slice(0, maxRubrics)\n .map((item) => item.entry);\n\n if (topPatterns.length === 0 && topRubrics.length === 0) return null;\n\n const lines: string[] = [\n \"## Institutional Learning (Compounded)\",\n \"\",\n ];\n\n if (topPatterns.length > 0) {\n lines.push(\"Avoid repeating these patterns:\");\n for (const entry of topPatterns) {\n const scope = entry.workflow ?? entry.agent ?? null;\n const metadata = [`recurrence=${entry.recurrenceCount}`];\n if (scope) metadata.push(`scope=${scope}`);\n lines.push(`- ${entry.pattern} _(${metadata.join(\", \")})_`);\n }\n lines.push(\"\");\n }\n\n if (topRubrics.length > 0) {\n lines.push(\"Active rubrics:\");\n for (const rubric of topRubrics) {\n const notes = rubric.observations.slice(0, 2).join(\"; \");\n lines.push(`- ${rubric.kind} ${rubric.subject}: ${notes}`);\n }\n }\n\n return lines.join(\"\\n\");\n }\n\n tierMigrationCycleBudget(trigger: TierMigrationCycleTrigger): TierMigrationCycleBudget {\n return defaultTierMigrationCycleBudget(this.config, trigger);\n }\n\n private async readFeedbackEntriesForWeek(weekId: string): Promise<FeedbackEntryWithProvenance[]> {\n // Minimal implementation: includes entries where date starts with any day in the ISO week.\n // We approximate by taking all entries and filtering by computed isoWeekId(date).\n const out: FeedbackEntryWithProvenance[] = [];\n try {\n const raw = await readFile(this.feedbackInboxPath, \"utf-8\");\n const lines = raw.split(\"\\n\");\n for (let idx = 0; idx < lines.length; idx += 1) {\n const line = lines[idx];\n if (!line.trim()) continue;\n try {\n const obj = JSON.parse(line);\n const parsed = SharedFeedbackEntrySchema.safeParse(obj);\n if (!parsed.success) continue;\n const d = new Date(parsed.data.date);\n if (!Number.isFinite(d.getTime())) continue;\n if (isoWeekId(d) !== weekId) continue;\n const sourceLine = idx + 1;\n out.push({\n entry: parsed.data,\n sourceLine,\n sourcePath: this.feedbackInboxPath,\n entryId: `${parsed.data.agent}-${parsed.data.date}-${sourceLine}`.replace(/[^a-zA-Z0-9._:-]/g, \"_\"),\n });\n } catch {\n // ignore\n }\n }\n } catch {\n // missing feedback is normal\n }\n return out;\n }\n\n private buildActionFailurePatterns(events: WeeklyActionEvent[]): string[] {\n const out: string[] = [];\n for (const event of events) {\n const failed = event.outcome === \"failed\" || event.outcome === \"skipped\";\n if (!failed && event.policyDecision === null) continue;\n const suffix = event.reason && event.reason.trim().length > 0\n ? ` - ${event.reason.trim().slice(0, 140)}`\n : \"\";\n out.push(\n `memory-action/${event.namespace}: ${event.action} ${event.outcome}${event.policyDecision ? `/${event.policyDecision}` : \"\"}${suffix}`,\n );\n }\n return out;\n }\n\n private async readActionEventsForWeek(weekId: string): Promise<WeeklyActionEvent[]> {\n const out: WeeklyActionEvent[] = [];\n const rows = await this.storage.readMemoryActionEventRows(Number.MAX_SAFE_INTEGER);\n for (const row of rows) {\n const event = row.event;\n const ts = new Date(event.timestamp);\n if (!Number.isFinite(ts.getTime()) || isoWeekId(ts) !== weekId) continue;\n out.push({\n line: row.line,\n action: event.action,\n outcome: event.outcome,\n policyDecision: event.policyDecision === \"deny\" || event.policyDecision === \"defer\"\n ? event.policyDecision\n : null,\n namespace: typeof event.namespace === \"string\" && event.namespace.length > 0 ? event.namespace : \"default\",\n reason: typeof event.reason === \"string\" ? event.reason : null,\n });\n }\n return out;\n }\n\n private buildActionOutcomeSummary(events: WeeklyActionEvent[]): ActionOutcomeSummary[] {\n const byAction = new Map<string, { counts: ActionOutcomeCounts; provenance: Set<string> }>();\n for (const event of events) {\n const key = event.action;\n const acc = byAction.get(key) ?? {\n counts: { applied: 0, skipped: 0, failed: 0 },\n provenance: new Set<string>(),\n };\n if (event.outcome === \"applied\") acc.counts.applied += 1;\n else if (event.outcome === \"skipped\") acc.counts.skipped += 1;\n else acc.counts.failed += 1;\n acc.provenance.add(`${path.basename(this.memoryActionEventsPath)}:L${event.line}`);\n byAction.set(key, acc);\n }\n\n const out: ActionOutcomeSummary[] = [];\n for (const [action, data] of byAction.entries()) {\n const total = data.counts.applied + data.counts.skipped + data.counts.failed;\n if (total <= 0) continue;\n // Conservative weighting: reward applied, penalize skipped/failed.\n const weightedScore = Number((((data.counts.applied * 1) - (data.counts.skipped * 0.5) - (data.counts.failed * 1.5)) / total).toFixed(3));\n out.push({\n action,\n counts: data.counts,\n total,\n weightedScore,\n provenance: [...data.provenance].sort().slice(0, 8),\n });\n }\n out.sort((a, b) => b.total - a.total || b.weightedScore - a.weightedScore || a.action.localeCompare(b.action));\n return out;\n }\n\n private derivePromotionCandidates(\n summary: ActionOutcomeSummary[],\n mistakes: MistakeRegistryEntry[],\n rubrics: RubricSnapshot,\n ): PromotionCandidate[] {\n const deduped = new Map<string, PromotionCandidate>();\n const upsert = (candidate: PromotionCandidate) => {\n const key = `${candidate.category}:${canonicalPromotionContentKey(candidate.content)}`;\n const existing = deduped.get(key);\n if (!existing) {\n deduped.set(key, candidate);\n return;\n }\n const mergedProvenance = [...new Set([...existing.provenance, ...candidate.provenance])];\n if (candidate.score > existing.score) {\n deduped.set(key, {\n ...candidate,\n provenance: mergedProvenance,\n });\n return;\n }\n existing.provenance = mergedProvenance;\n };\n\n for (const item of summary) {\n if (item.total < 3) continue;\n if (item.weightedScore < 0.3) continue;\n const content = normalizePromotedGuidanceContent(\n `Prefer ${item.action} when the same workflow recurs; this week's outcomes were applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed}.`,\n );\n upsert({\n id: stablePromotionCandidateId(\"action-outcome\", item.action, content),\n sourceType: \"action-outcome\",\n subject: item.action,\n category: promotionCategoryForContent(content),\n content,\n score: item.weightedScore,\n rationale: \"High applied ratio with low failure/skips in weekly outcome telemetry.\",\n outcome: item.counts,\n provenance: item.provenance,\n agent: null,\n workflow: \"memory-actions\",\n });\n }\n\n for (const entry of mistakes) {\n if (entry.status !== \"active\") continue;\n if (entry.recurrenceCount < 2) continue;\n const content = normalizePromotedGuidanceContent(lessonContentFromPattern(entry.pattern, entry.agent));\n if (content.length === 0) continue;\n const confidence = entry.confidence ?? 0.75;\n const score = Number(Math.min(0.97, 0.45 + Math.min(entry.recurrenceCount, 6) * 0.08 + confidence * 0.15).toFixed(3));\n upsert({\n id: stablePromotionCandidateId(\"mistake-pattern\", entry.id, content),\n sourceType: \"mistake-pattern\",\n subject: entry.pattern,\n category: promotionCategoryForContent(content),\n content,\n score,\n rationale: `Recurring lesson still active after ${entry.recurrenceCount} confirmations in the mistake registry.`,\n outcome: null,\n provenance: entry.provenance.length > 0 ? entry.provenance : [`mistakes.json#${entry.id}`],\n agent: entry.agent,\n workflow: entry.workflow,\n });\n }\n\n for (const rubric of [...rubrics.workflows, ...rubrics.agents]) {\n for (const observation of this.getRubricObservationEntries(rubric)) {\n if (this.isSyntheticOutcomeRubricObservation(observation.note)) continue;\n const evidenceCount = observation.provenance.length;\n if (evidenceCount < 2) continue;\n const content = normalizePromotedGuidanceContent(observation.note);\n if (content.length === 0) continue;\n const score = Number(Math.min(0.95, 0.5 + Math.min(evidenceCount, 5) * 0.08).toFixed(3));\n upsert({\n id: stablePromotionCandidateId(\"rubric\", `${rubric.id}:${observation.note}`, content),\n sourceType: \"rubric\",\n subject: `${rubric.kind}:${rubric.subject}`,\n category: promotionCategoryForContent(content),\n content,\n score,\n rationale: `Rubric guidance repeated across ${evidenceCount} supporting observations.`,\n outcome: null,\n provenance: observation.provenance,\n agent: rubric.kind === \"agent\" ? rubric.subject : null,\n workflow: rubric.kind === \"workflow\" ? rubric.subject : null,\n });\n }\n }\n\n return [...deduped.values()]\n .sort((a, b) => b.score - a.score || a.subject.localeCompare(b.subject))\n .slice(0, 10);\n }\n\n private buildMistakes(\n entries: FeedbackEntryWithProvenance[],\n actionPatterns: string[] = [],\n weekId: string,\n previousRegistry: MistakeRegistryEntry[] = [],\n ): MistakesFile & { details: PatternWithProvenance[]; registry: MistakeRegistryEntry[] } {\n const patterns: PatternWithProvenance[] = [];\n const evidenceByPattern = new Map<string, {\n category: \"feedback\" | \"action\";\n agent: string | null;\n workflow: string | null;\n tags: Set<string>;\n severity: CompoundingEntrySeverity | null;\n confidence: number | null;\n outcome: string | null;\n timestamps: string[];\n evidenceWindow: EvidenceWindow;\n }>();\n\n for (const wrapped of entries) {\n const e = wrapped.entry;\n const pattern = e.learning && e.learning.trim().length > 0\n ? `${e.agent}: ${e.learning.trim()}`\n : e.decision === \"rejected\"\n ? `${e.agent}: ${e.reason.trim()}`.slice(0, 240)\n : null;\n if (!pattern) continue;\n const provenance = [`${path.basename(wrapped.sourcePath)}:L${wrapped.sourceLine}#${wrapped.entryId}`];\n patterns.push({ pattern, provenance });\n\n const previous = evidenceByPattern.get(pattern) ?? {\n category: \"feedback\" as const,\n agent: e.agent,\n workflow: e.workflow ?? null,\n tags: new Set<string>(),\n severity: e.severity ?? null,\n confidence: normalizeConfidence(e.confidence),\n outcome: e.outcome?.trim() || null,\n timestamps: [],\n evidenceWindow: normalizeEvidenceWindow(e.evidenceWindowStart, e.evidenceWindowEnd),\n };\n for (const tag of normalizeTags(e.tags)) previous.tags.add(tag);\n previous.timestamps.push(e.date);\n if (previous.workflow === null && e.workflow) previous.workflow = e.workflow;\n if (previous.severity === null && e.severity) previous.severity = e.severity;\n if (previous.confidence === null) previous.confidence = normalizeConfidence(e.confidence);\n if (previous.outcome === null && e.outcome) previous.outcome = e.outcome.trim();\n const nextEvidenceWindow = normalizeEvidenceWindow(e.evidenceWindowStart, e.evidenceWindowEnd);\n previous.evidenceWindow = mergeEvidenceWindows(previous.evidenceWindow, nextEvidenceWindow);\n evidenceByPattern.set(pattern, previous);\n }\n\n for (const pattern of actionPatterns) {\n patterns.push({ pattern, provenance: [`${path.basename(this.memoryActionEventsPath)}:*`] });\n const previous = evidenceByPattern.get(pattern) ?? {\n category: \"action\" as const,\n agent: null,\n workflow: \"memory-actions\",\n tags: new Set<string>(),\n severity: \"medium\" as CompoundingEntrySeverity,\n confidence: null,\n outcome: null,\n timestamps: [],\n evidenceWindow: { start: null, end: null },\n };\n evidenceByPattern.set(pattern, previous);\n }\n\n const byPattern = new Map<string, Set<string>>();\n for (const item of patterns) {\n const existing = byPattern.get(item.pattern) ?? new Set<string>();\n for (const provenance of item.provenance) existing.add(provenance);\n byPattern.set(item.pattern, existing);\n }\n\n const details = [...byPattern.entries()]\n .map(([pattern, provenance]) => ({ pattern, provenance: [...provenance].sort() }))\n .slice(0, 500);\n const previousById = new Map(previousRegistry.map((entry) => [entry.id, entry]));\n const previousByPattern = new Map(previousRegistry.map((entry) => [entry.pattern, entry]));\n const registry: MistakeRegistryEntry[] = details.map((detail) => {\n const evidence = evidenceByPattern.get(detail.pattern);\n const id = stableMistakeId(\n evidence?.category ?? \"feedback\",\n detail.pattern,\n evidence?.agent ?? null,\n evidence?.workflow ?? null,\n );\n const previous = previousById.get(id) ?? previousByPattern.get(detail.pattern);\n const timestamps = (evidence?.timestamps ?? []).filter((value) => typeof value === \"string\" && value.length > 0).sort();\n const firstSeenAt = previous?.firstSeenAt ?? timestamps[0] ?? new Date().toISOString();\n const lastSeenAt = timestamps[timestamps.length - 1] ?? previous?.lastSeenAt ?? firstSeenAt;\n return {\n id,\n pattern: detail.pattern,\n category: evidence?.category ?? \"feedback\",\n status: \"active\" as const,\n agent: evidence?.agent ?? null,\n workflow: evidence?.workflow ?? null,\n tags: evidence ? [...evidence.tags].sort() : [],\n severity: evidence?.severity ?? null,\n confidence: evidence?.confidence ?? null,\n outcome: evidence?.outcome ?? null,\n provenance: detail.provenance,\n firstSeenAt,\n lastSeenAt,\n recurrenceCount: previous?.lastWeekId === weekId ? previous.recurrenceCount : (previous?.recurrenceCount ?? 0) + 1,\n lastWeekId: weekId,\n evidenceWindow: evidence?.evidenceWindow ?? { start: null, end: null },\n retiredAt: null,\n } satisfies MistakeRegistryEntry;\n });\n\n const seenIds = new Set(registry.map((entry) => entry.id));\n const seenPatterns = new Set(registry.map((entry) => entry.pattern));\n for (const previous of previousRegistry) {\n if (seenIds.has(previous.id) || seenPatterns.has(previous.pattern)) continue;\n const staleWeeks = weekIdToIndex(weekId) - weekIdToIndex(previous.lastWeekId);\n registry.push({\n ...previous,\n status: staleWeeks >= RETIREMENT_WINDOW_WEEKS ? \"retired\" : previous.status,\n retiredAt: staleWeeks >= RETIREMENT_WINDOW_WEEKS\n ? previous.retiredAt ?? new Date().toISOString()\n : previous.retiredAt ?? null,\n });\n }\n\n registry.sort((a, b) =>\n Number(b.status === \"active\") - Number(a.status === \"active\") ||\n b.recurrenceCount - a.recurrenceCount ||\n b.lastSeenAt.localeCompare(a.lastSeenAt) ||\n a.pattern.localeCompare(b.pattern),\n );\n\n return {\n version: COMPOUNDING_VERSION,\n updatedAt: new Date().toISOString(),\n patterns: details.map((d) => d.pattern),\n details,\n registry,\n };\n }\n\n private formatWeeklyReport(\n weekId: string,\n entries: FeedbackEntryWithProvenance[],\n patterns: string[],\n patternDetails: PatternWithProvenance[],\n continuity: { monthId: string; weeklyPath: string | null; monthlyPath: string | null },\n outcomeSummary: ActionOutcomeSummary[],\n promotionCandidates: PromotionCandidate[],\n ): string {\n const byAgent = new Map<string, FeedbackEntryWithProvenance[]>();\n for (const wrapped of entries) {\n const list = byAgent.get(wrapped.entry.agent) ?? [];\n list.push(wrapped);\n byAgent.set(wrapped.entry.agent, list);\n }\n\n const lines: string[] = [\n `# Weekly Compounding — ${weekId}`,\n \"\",\n \"This file is generated by Engram's compounding engine (v5.0).\",\n \"\",\n \"## Summary\",\n `- Feedback entries: ${entries.length}`,\n `- Mistake patterns: ${patterns.length}`,\n \"\",\n \"## By Agent\",\n ];\n\n if (byAgent.size === 0) {\n lines.push(\"- (none)\");\n } else {\n for (const [agent, list] of Array.from(byAgent.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {\n const approved = list.filter((e) => e.entry.decision === \"approved\").length;\n const awf = list.filter((e) => e.entry.decision === \"approved_with_feedback\").length;\n const rejected = list.filter((e) => e.entry.decision === \"rejected\").length;\n lines.push(`### ${agent}`);\n lines.push(`- approved: ${approved}`);\n lines.push(`- approved_with_feedback: ${awf}`);\n lines.push(`- rejected: ${rejected}`);\n const provenance = list\n .slice(0, 3)\n .map((e) => `${path.basename(e.sourcePath)}:L${e.sourceLine}#${e.entryId}`);\n if (provenance.length > 0) {\n lines.push(`- provenance: ${provenance.join(\", \")}`);\n }\n lines.push(\"\");\n }\n }\n\n lines.push(\"## Patterns (Avoid / Prefer)\");\n if (patterns.length === 0) {\n lines.push(\"- (none yet)\");\n } else {\n const detailMap = new Map(patternDetails.map((d) => [d.pattern, d.provenance]));\n for (const p of patterns.slice(0, 100)) {\n const provenance = detailMap.get(p) ?? [];\n if (provenance.length > 0) {\n lines.push(`- ${p} _(source: ${provenance.join(\", \")})_`);\n } else {\n lines.push(`- ${p}`);\n }\n }\n }\n lines.push(\"\");\n\n lines.push(\"## Outcome Weighting\");\n if (outcomeSummary.length === 0) {\n lines.push(\"- (no action outcomes recorded this week)\");\n } else {\n for (const item of outcomeSummary.slice(0, 20)) {\n lines.push(\n `- ${item.action}: applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed}, weight=${item.weightedScore} _(source: ${item.provenance.join(\", \")})_`,\n );\n }\n }\n lines.push(\"\");\n\n if (resolveConsolidationCapabilities(this.config).compoundingSemantic) {\n lines.push(\"## Promotion Candidates (Advisory)\");\n if (promotionCandidates.length === 0) {\n lines.push(\"- (no advisory promotion candidates this week)\");\n } else {\n for (const candidate of promotionCandidates) {\n const outcomeSummaryText = candidate.outcome\n ? ` outcomes[a=${candidate.outcome.applied}, s=${candidate.outcome.skipped}, f=${candidate.outcome.failed}]`\n : \"\";\n lines.push(\n `- [${candidate.sourceType}] ${candidate.subject} -> ${candidate.content} (category=${candidate.category}, score=${candidate.score}, id=${candidate.id}): ${candidate.rationale}${outcomeSummaryText} _(source: ${candidate.provenance.join(\", \")})_`,\n );\n }\n }\n lines.push(\"\");\n lines.push(\"_Advisory only: no automatic promotion write is performed by this report. Use `compounding_promote_candidate` or `openclaw engram compounding-promote` to persist one manually._\");\n lines.push(\"\");\n }\n\n if (resolveConsolidationCapabilities(this.config).continuityAudit) {\n lines.push(\"## Continuity Audits\");\n if (continuity.weeklyPath) {\n lines.push(`- weekly: ${continuity.weeklyPath}`);\n } else {\n lines.push(`- weekly: (missing for ${weekId})`);\n }\n if (continuity.monthlyPath) {\n lines.push(`- monthly: ${continuity.monthlyPath}`);\n } else {\n lines.push(`- monthly: (missing for ${continuity.monthId})`);\n }\n lines.push(\"\");\n }\n\n return lines.join(\"\\n\");\n }\n\n private buildRubricSnapshot(\n entries: FeedbackEntryWithProvenance[],\n outcomeSummary: ActionOutcomeSummary[],\n ): RubricSnapshot {\n const updatedAt = new Date().toISOString();\n const byAgent = new Map<string, RubricSnapshotEntry>();\n const byWorkflow = new Map<string, RubricSnapshotEntry>();\n\n for (const wrapped of entries) {\n const note = ((wrapped.entry.learning && wrapped.entry.learning.trim().length > 0)\n ? wrapped.entry.learning\n : wrapped.entry.decision === \"rejected\"\n ? wrapped.entry.reason\n : \"\").trim();\n if (!note) continue;\n const provenance = `${path.basename(wrapped.sourcePath)}:L${wrapped.sourceLine}#${wrapped.entryId}`;\n const agentEntry = byAgent.get(wrapped.entry.agent) ?? {\n id: stableRubricId(\"agent\", wrapped.entry.agent),\n kind: \"agent\" as const,\n subject: wrapped.entry.agent,\n observations: [],\n tags: [],\n provenance: [],\n observationEntries: [],\n updatedAt,\n };\n this.addRubricObservation(agentEntry, note, provenance);\n agentEntry.tags = normalizeTags([...agentEntry.tags, ...normalizeTags(wrapped.entry.tags)]);\n byAgent.set(wrapped.entry.agent, agentEntry);\n\n const workflow = wrapped.entry.workflow?.trim();\n if (!workflow) continue;\n const workflowEntry = byWorkflow.get(workflow) ?? {\n id: stableRubricId(\"workflow\", workflow),\n kind: \"workflow\" as const,\n subject: workflow,\n observations: [],\n tags: [],\n provenance: [],\n observationEntries: [],\n updatedAt,\n };\n this.addRubricObservation(workflowEntry, note, provenance);\n workflowEntry.tags = normalizeTags([...workflowEntry.tags, ...normalizeTags(wrapped.entry.tags)]);\n byWorkflow.set(workflow, workflowEntry);\n }\n\n for (const item of outcomeSummary) {\n const workflowEntry = byWorkflow.get(item.action) ?? {\n id: stableRubricId(\"workflow\", item.action),\n kind: \"workflow\" as const,\n subject: item.action,\n observations: [],\n tags: [],\n provenance: [],\n observationEntries: [],\n updatedAt,\n };\n this.addRubricObservation(\n workflowEntry,\n `Outcome weight=${item.weightedScore} (applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed})`,\n ...item.provenance,\n );\n byWorkflow.set(item.action, workflowEntry);\n }\n\n return {\n updatedAt,\n agents: [...byAgent.values()].sort((a, b) => a.subject.localeCompare(b.subject)),\n workflows: [...byWorkflow.values()].sort((a, b) => a.subject.localeCompare(b.subject)),\n };\n }\n\n private formatRubrics(outcomeSummary: ActionOutcomeSummary[], snapshot: RubricSnapshot): string {\n const lines: string[] = [\n \"# Compounding Rubrics\",\n \"\",\n `Generated: ${snapshot.updatedAt}`,\n \"\",\n \"Stable, deterministic rubric snapshot generated from weekly feedback + action outcomes.\",\n \"\",\n ];\n\n lines.push(\"## Agent Rubrics\");\n if (snapshot.agents.length === 0) {\n lines.push(\"- (none yet)\");\n } else {\n for (const rubric of snapshot.agents) {\n lines.push(`### ${rubric.subject}`);\n const observations = this.getRubricObservationEntries(rubric).slice(0, 8);\n if (observations.length === 0) {\n lines.push(\"- No rubric deltas this week.\");\n } else {\n for (const observation of observations) {\n const provenance = observation.provenance.join(\", \");\n lines.push(`- ${observation.note}${provenance ? ` _(source: ${provenance})_` : \"\"}`);\n }\n }\n lines.push(\"\");\n }\n }\n\n lines.push(\"## Workflow Rubrics\");\n if (snapshot.workflows.length === 0) {\n lines.push(\"- (none yet)\");\n } else {\n for (const rubric of snapshot.workflows) {\n lines.push(`### ${rubric.subject}`);\n for (const observation of this.getRubricObservationEntries(rubric).slice(0, 8)) {\n const provenance = observation.provenance.join(\", \");\n lines.push(`- ${observation.note}${provenance ? ` _(source: ${provenance})_` : \"\"}`);\n }\n lines.push(\"\");\n }\n }\n\n lines.push(\"## Action Outcome Signals\");\n if (outcomeSummary.length === 0) {\n lines.push(\"- (none yet)\");\n } else {\n for (const item of outcomeSummary.slice(0, 20)) {\n lines.push(\n `- ${item.action}: weight=${item.weightedScore} (applied=${item.counts.applied}, skipped=${item.counts.skipped}, failed=${item.counts.failed})`,\n );\n }\n }\n lines.push(\"\");\n return lines.join(\"\\n\");\n }\n\n private async syncRubricArtifacts(snapshot: RubricSnapshot): Promise<void> {\n await this.replaceRubricDirectory(this.rubricsAgentsDir, snapshot.agents);\n await this.replaceRubricDirectory(this.rubricsWorkflowsDir, snapshot.workflows);\n }\n\n private async replaceRubricDirectory(dir: string, entries: RubricSnapshotEntry[]): Promise<void> {\n await mkdir(dir, { recursive: true });\n try {\n const names = await readdir(dir);\n await Promise.all(\n names.filter((name) => name.endsWith(\".md\")).map((name) => unlink(path.join(dir, name)).catch(() => undefined)),\n );\n } catch {\n // fail-open\n }\n\n const slugCollisions = new Map<string, number>();\n for (const entry of entries) {\n const slug = stableSlug(entry.subject);\n slugCollisions.set(slug, (slugCollisions.get(slug) ?? 0) + 1);\n }\n\n await Promise.all(entries.map(async (entry) => {\n const observationEntries = this.getRubricObservationEntries(entry);\n const body = [\n `# ${entry.kind === \"agent\" ? \"Agent\" : \"Workflow\"} Rubric — ${entry.subject}`,\n \"\",\n `Updated: ${entry.updatedAt}`,\n \"\",\n \"## Observations\",\n ...(observationEntries.length > 0\n ? observationEntries.map((item) => `- ${item.note}`)\n : [\"- (none yet)\"]),\n \"\",\n \"## Provenance\",\n ...(entry.provenance.length > 0 ? entry.provenance.map((item) => `- ${item}`) : [\"- (none yet)\"]),\n \"\",\n ].join(\"\\n\");\n const fileName = rubricArtifactFileName(entry, slugCollisions);\n await writeFile(path.join(dir, fileName), body, \"utf-8\");\n }));\n }\n\n private scoreRubricForQuery(entry: RubricSnapshotEntry, queryTokens: string[]): number {\n if (queryTokens.length === 0) return entry.observations.length;\n const haystack = [entry.subject, ...entry.observations, ...entry.tags].join(\" \").toLowerCase();\n let score = 0;\n for (const token of queryTokens) {\n if (haystack.includes(token)) score += 2;\n if (entry.subject.toLowerCase().includes(token)) score += 2;\n }\n if (score === 0) return 0;\n return score + Math.min(entry.observations.length, 3);\n }\n\n private normalizeRubricEntry(entry: RubricSnapshotEntry): RubricSnapshotEntry {\n const normalizedEntries = this.getRubricObservationEntries(entry);\n return {\n ...entry,\n observations: normalizedEntries.map((item) => item.note),\n provenance: [...new Set(normalizedEntries.flatMap((item) => item.provenance))],\n observationEntries: normalizedEntries,\n };\n }\n\n private getRubricObservationEntries(entry: RubricSnapshotEntry): Array<{ note: string; provenance: string[] }> {\n if (Array.isArray(entry.observationEntries) && entry.observationEntries.length > 0) {\n return entry.observationEntries.map((item) => ({\n note: item.note,\n provenance: [...new Set(item.provenance)].sort(),\n }));\n }\n\n return entry.observations.map((note, index) => ({\n note,\n provenance: entry.provenance[index] ? [entry.provenance[index]] : (entry.provenance[0] ? [entry.provenance[0]] : []),\n }));\n }\n\n private isSyntheticOutcomeRubricObservation(note: string): boolean {\n return note.trimStart().startsWith(\"Outcome weight=\");\n }\n\n private addRubricObservation(entry: RubricSnapshotEntry, note: string, ...provenance: string[]): void {\n const normalized = this.normalizeRubricEntry(entry);\n const existing = normalized.observationEntries?.find((item) => item.note === note);\n if (existing) {\n existing.provenance = [...new Set([...existing.provenance, ...provenance])].sort();\n } else {\n normalized.observationEntries?.push({\n note,\n provenance: [...new Set(provenance)].sort(),\n });\n }\n entry.observationEntries = normalized.observationEntries;\n entry.observations = normalized.observationEntries?.map((item) => item.note) ?? [];\n entry.provenance = [...new Set((normalized.observationEntries ?? []).flatMap((item) => item.provenance))];\n }\n\n private async readOptionalIdentityAnchorForAudit(): Promise<string | null> {\n try {\n return await this.storage.readIdentityAnchor();\n } catch {\n return null;\n }\n }\n\n private async readOptionalImprovementLoopsForAudit(): Promise<string | null> {\n try {\n return await this.storage.readIdentityImprovementLoops();\n } catch {\n return null;\n }\n }\n\n private async readContinuityIncidentsForAudit(\n limit: number,\n state: \"open\" | \"closed\",\n ): Promise<ContinuityIncidentRecord[]> {\n try {\n return await this.storage.readContinuityIncidents(limit, state);\n } catch {\n return [];\n }\n }\n\n private async readOptionalIdentityAuditForReference(\n period: \"weekly\" | \"monthly\",\n key: string,\n ): Promise<string | null> {\n try {\n return await this.storage.readIdentityAudit(period, key);\n } catch {\n return null;\n }\n }\n\n private async readContinuityAuditReferences(weekId: string): Promise<{\n weekId: string;\n monthId: string;\n weeklyPath: string | null;\n monthlyPath: string | null;\n }> {\n const monthId = monthIdFromIsoWeek(weekId);\n const weeklyPath = path.join(this.identityAuditWeeklyDir, `${weekId}.md`);\n const monthlyPath = path.join(this.identityAuditMonthlyDir, `${monthId}.md`);\n const [weeklyAudit, monthlyAudit] = await Promise.all([\n this.readOptionalIdentityAuditForReference(\"weekly\", weekId),\n this.readOptionalIdentityAuditForReference(\"monthly\", monthId),\n ]);\n const weeklyExists = (weeklyAudit ?? \"\").trim().length > 0;\n const monthlyExists = (monthlyAudit ?? \"\").trim().length > 0;\n return {\n weekId,\n monthId,\n weeklyPath: weeklyExists ? weeklyPath : null,\n monthlyPath: monthlyExists ? monthlyPath : null,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,OAAO,UAAU,SAAS,QAAQ,iBAAiB;AAC5D,OAAO,UAAU;AAmLjB,IAAM,sBAAsB;AAC5B,IAAM,0BAA0B;AAEhC,SAAS,WAAW,OAAuB;AACzC,SAAO,MACJ,YAAY,EACZ,QAAQ,eAAe,GAAG,EAC1B,QAAQ,YAAY,EAAE,EACtB,MAAM,GAAG,EAAE,KAAK;AACrB;AAEA,SAAS,oBAAoB,MAAwB;AACnD,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,MAAgB,CAAC;AACvB,aAAW,SAAS,KACjB,YAAY,EACZ,QAAQ,iBAAiB,GAAG,EAC5B,MAAM,KAAK,EACX,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,CAAC,SAAS,KAAK,UAAU,CAAC,GAAG;AACrC,QAAI,KAAK,IAAI,KAAK,EAAG;AACrB,SAAK,IAAI,KAAK;AACd,QAAI,KAAK,KAAK;AAAA,EAChB;AACA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,MAAc,gCACZ,OACA,OACqC;AACrC,QAAI;AACF,aAAO,MAAM,KAAK,QAAQ,wBAAwB,OAAO,KAAK;AAAA,IAChE,QAAQ;AACN,aAAO,CAAC;AAAA,IACV;AAAA,EACF;AAAA,EAEA,MAAc,sCACZ,QACA,KACwB;AACxB,QAAI;AACF,aAAO,MAAM,KAAK,QAAQ,kBAAkB,QAAQ,GAAG;AAAA,IACzD,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,MAAc,8BAA8B,QAKzC;AACD,UAAM,UAAU,mBAAmB,MAAM;AACzC,UAAM,aAAa,KAAK,KAAK,KAAK,wBAAwB,GAAG,MAAM,KAAK;AACxE,UAAM,cAAc,KAAK,KAAK,KAAK,yBAAyB,GAAG,OAAO,KAAK;AAC3E,UAAM,CAAC,aAAa,YAAY,IAAI,MAAM,QAAQ,IAAI;AAAA,MACpD,KAAK,sCAAsC,UAAU,MAAM;AAAA,MAC3D,KAAK,sCAAsC,WAAW,OAAO;AAAA,IAC/D,CAAC;AACD,UAAM,gBAAgB,eAAe,IAAI,KAAK,EAAE,SAAS;AACzD,UAAM,iBAAiB,gBAAgB,IAAI,KAAK,EAAE,SAAS;AAC3D,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,YAAY,eAAe,aAAa;AAAA,MACxC,aAAa,gBAAgB,cAAc;AAAA,IAC7C;AAAA,EACF;AACF;","names":["limit"]}
@@ -143,9 +143,6 @@ import {
143
143
  import {
144
144
  formatProfileTraceAscii
145
145
  } from "./chunk-BLVHDY2U.js";
146
- import {
147
- LocalLlmClient
148
- } from "./chunk-JXSYWTFK.js";
149
146
  import {
150
147
  REDACTION_RULES_SUBDIR
151
148
  } from "./chunk-LTHVM4XN.js";
@@ -204,6 +201,9 @@ import {
204
201
  import {
205
202
  ExtractionDeadlineError
206
203
  } from "./chunk-KE5PWLI6.js";
204
+ import {
205
+ LocalLlmClient
206
+ } from "./chunk-JXSYWTFK.js";
207
207
  import {
208
208
  meetingsBuild,
209
209
  meetingsGet,
@@ -18734,4 +18734,4 @@ export {
18734
18734
  EngramAccessService,
18735
18735
  AccessAdminOpsSurface
18736
18736
  };
18737
- //# sourceMappingURL=chunk-GVUW5XK5.js.map
18737
+ //# sourceMappingURL=chunk-DTXN4NVD.js.map
@@ -2,7 +2,7 @@ import {
2
2
  SupportPassportError,
3
3
  SupportPassportOwnerCreateGrantRequestSchema,
4
4
  getOperation
5
- } from "./chunk-GVUW5XK5.js";
5
+ } from "./chunk-DTXN4NVD.js";
6
6
 
7
7
  // src/support-passport/access-http.ts
8
8
  var OWNER_ROOT = "/engram/v1/support-passport";
@@ -137,4 +137,4 @@ export {
137
137
  SUPPORT_PASSPORT_OWNER_HTTP_ROUTES,
138
138
  handleSupportPassportOwnerHttp
139
139
  };
140
- //# sourceMappingURL=chunk-5CQO6LVM.js.map
140
+ //# sourceMappingURL=chunk-KCCZFDJD.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-7T4TOGMS.js";
4
4
  import {
5
5
  defineOperation
6
- } from "./chunk-GVUW5XK5.js";
6
+ } from "./chunk-DTXN4NVD.js";
7
7
 
8
8
  // src/external-wiki-access.ts
9
9
  import { z } from "zod";
@@ -26,4 +26,4 @@ var externalWikiSearchOperation = defineOperation({
26
26
  export {
27
27
  externalWikiSearchOperation
28
28
  };
29
- //# sourceMappingURL=chunk-I25RINZK.js.map
29
+ //# sourceMappingURL=chunk-KQT4DRKF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defineOperation
3
- } from "./chunk-GVUW5XK5.js";
3
+ } from "./chunk-DTXN4NVD.js";
4
4
  import {
5
5
  EngramAccessInputError
6
6
  } from "./chunk-3MUKQQ7A.js";
@@ -92,4 +92,4 @@ defineOperation({
92
92
  };
93
93
  }
94
94
  });
95
- //# sourceMappingURL=chunk-AXC7UTLM.js.map
95
+ //# sourceMappingURL=chunk-MH2DXDN6.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defineOperation
3
- } from "./chunk-GVUW5XK5.js";
3
+ } from "./chunk-DTXN4NVD.js";
4
4
  import {
5
5
  EngramAccessInputError
6
6
  } from "./chunk-3MUKQQ7A.js";
@@ -71,4 +71,4 @@ defineOperation({
71
71
  })
72
72
  })
73
73
  });
74
- //# sourceMappingURL=chunk-FRH2UC7Q.js.map
74
+ //# sourceMappingURL=chunk-Q562GF7J.js.map
@@ -21,7 +21,7 @@ import {
21
21
  defineOperation,
22
22
  parseNamespacePreflightWriteOp,
23
23
  resolveAuthorizedNamespaceWritablePreflight
24
- } from "./chunk-GVUW5XK5.js";
24
+ } from "./chunk-DTXN4NVD.js";
25
25
  import {
26
26
  parseSharedWriteOutputControls
27
27
  } from "./chunk-IFBSZGW3.js";
@@ -603,4 +603,4 @@ defineOperation({ name: "graph_events", description: "SSE graph events.", schema
603
603
  defineOperation({ name: "chat_message", description: "Chat message.", schema: strictSchema({ message: S.str, chatSessionId: S.str }), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
604
604
  defineOperation({ name: "chat_events", description: "SSE chat events.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: "sse" } }) });
605
605
  defineOperation({ name: "adapters_status", description: "Adapter registry metadata (issue #1850 round 5). Marker op: the HTTP transport builds the response from its own adapterRegistry, but the op still must be registered so it appears in listRegisteredOperations and enforceTokenOp can gate it for scoped tokens.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
606
- //# sourceMappingURL=chunk-NHSVW7UT.js.map
606
+ //# sourceMappingURL=chunk-QEPL7KIZ.js.map
@@ -49,7 +49,7 @@ import {
49
49
  } from "./chunk-KIUVEMBI.js";
50
50
  import {
51
51
  getOperation
52
- } from "./chunk-GVUW5XK5.js";
52
+ } from "./chunk-DTXN4NVD.js";
53
53
  import {
54
54
  WHO_KNOWS_MCP_TOOLS
55
55
  } from "./chunk-XQSJXNWC.js";
@@ -3986,4 +3986,4 @@ export {
3986
3986
  MCP_MIGRATED_OPERATIONS,
3987
3987
  EngramMcpServer
3988
3988
  };
3989
- //# sourceMappingURL=chunk-5BY3IA2U.js.map
3989
+ //# sourceMappingURL=chunk-QGLEM46C.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SupportPassportCreateGrantRequestSchema,
3
3
  defineOperation
4
- } from "./chunk-GVUW5XK5.js";
4
+ } from "./chunk-DTXN4NVD.js";
5
5
  import {
6
6
  SupportPassportCardCategorySchema,
7
7
  SupportPassportMemoryIdSchema,
@@ -220,4 +220,4 @@ var supportPassportGrantAskOperation = defineOperation({
220
220
  result: await ctx.service.supportPassportAskGrant(grantId, secret, question, ctx.abortSignal)
221
221
  })
222
222
  });
223
- //# sourceMappingURL=chunk-V32NHP2R.js.map
223
+ //# sourceMappingURL=chunk-TL4PM7PC.js.map
@@ -210,7 +210,7 @@ import {
210
210
  import {
211
211
  EngramAccessHttpServer,
212
212
  MeetingsInputError
213
- } from "./chunk-WRICYGYG.js";
213
+ } from "./chunk-2UF42WXV.js";
214
214
  import {
215
215
  WearablesInputError
216
216
  } from "./chunk-V7IZKJI3.js";
@@ -220,10 +220,10 @@ import {
220
220
  loadChatSession,
221
221
  processChatMessage,
222
222
  sessionBelongsToPrincipal
223
- } from "./chunk-5BY3IA2U.js";
223
+ } from "./chunk-QGLEM46C.js";
224
224
  import {
225
225
  EngramAccessService
226
- } from "./chunk-GVUW5XK5.js";
226
+ } from "./chunk-DTXN4NVD.js";
227
227
  import {
228
228
  WorkStorage
229
229
  } from "./chunk-MPC7TYTZ.js";
@@ -10136,4 +10136,4 @@ export {
10136
10136
  listMemoryMarkdownFilePaths,
10137
10137
  registerCli
10138
10138
  };
10139
- //# sourceMappingURL=chunk-52CQKST6.js.map
10139
+ //# sourceMappingURL=chunk-TRBLJU6Y.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SUPPORT_PASSPORT_DRAFT_MAX_CONTENT_CHARACTERS,
3
3
  SUPPORT_PASSPORT_DRAFT_MAX_MEMORIES
4
- } from "./chunk-GVUW5XK5.js";
4
+ } from "./chunk-DTXN4NVD.js";
5
5
  import {
6
6
  SUPPORT_PASSPORT_SOURCE_MEMORY_ID_MAX_LENGTH
7
7
  } from "./chunk-PWPIERBM.js";
@@ -343,4 +343,4 @@ export {
343
343
  parseSupportPassportModelJob,
344
344
  SupportPassportModelBridge
345
345
  };
346
- //# sourceMappingURL=chunk-M47Q6566.js.map
346
+ //# sourceMappingURL=chunk-VUEG3TZ4.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SupportPassportError,
3
3
  getOperation
4
- } from "./chunk-GVUW5XK5.js";
4
+ } from "./chunk-DTXN4NVD.js";
5
5
  import {
6
6
  abortError,
7
7
  isAbortError
@@ -499,4 +499,4 @@ export {
499
499
  buildSupportPassportPublicRequestHandler,
500
500
  composeSupportPassportExternalRequestHandlers
501
501
  };
502
- //# sourceMappingURL=chunk-DST7HRSG.js.map
502
+ //# sourceMappingURL=chunk-YGPXV546.js.map