omp-superagent 0.1.11 → 0.1.15

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 (82) hide show
  1. package/DESIGN.md +21 -5
  2. package/README.ko.md +3 -1
  3. package/README.md +3 -1
  4. package/THIRD_PARTY_NOTICES.md +6 -0
  5. package/assets/architecture-dark.svg +4 -4
  6. package/assets/architecture.ko-dark.svg +4 -4
  7. package/assets/architecture.ko.svg +4 -4
  8. package/assets/architecture.mmd +5 -5
  9. package/assets/architecture.svg +4 -4
  10. package/config.example.json +1 -0
  11. package/docs/OPERATIONS.en.md +242 -31
  12. package/docs/OPERATIONS.md +225 -25
  13. package/docs/design/execution.md +161 -43
  14. package/docs/design/messaging.md +45 -9
  15. package/docs/releases/0.1.11.md +4 -2
  16. package/docs/releases/0.1.13.md +13 -0
  17. package/docs/releases/0.1.15.md +13 -0
  18. package/gateway/bin/omp-gateway-darwin-arm64 +0 -0
  19. package/gateway/bin/omp-gateway-darwin-x64 +0 -0
  20. package/gateway/bin/omp-gateway-linux-arm64 +0 -0
  21. package/gateway/bin/omp-gateway-linux-x64 +0 -0
  22. package/host-owner/bin/omp-host-owner-darwin-arm64 +0 -0
  23. package/host-owner/bin/omp-host-owner-darwin-x64 +0 -0
  24. package/host-owner/bin/omp-host-owner-linux-arm64 +0 -0
  25. package/host-owner/bin/omp-host-owner-linux-x64 +0 -0
  26. package/package.json +9 -3
  27. package/scripts/prepare-worker-memory.ts +37 -0
  28. package/scripts/upgrade-evidence-files.mjs +100 -0
  29. package/scripts/upgrade-evidence.mjs +192 -0
  30. package/scripts/upgrade-host-wire.mjs +162 -0
  31. package/skills/head/SKILL.md +22 -47
  32. package/skills/head/references/routing.md +11 -12
  33. package/skills/head/references/supervision.md +10 -14
  34. package/skills/lane/SKILL.md +14 -16
  35. package/skills/lane/references/workflow.md +14 -27
  36. package/src/cli.ts +59 -79
  37. package/src/config/config.ts +4 -0
  38. package/src/contracts.ts +34 -27
  39. package/src/cron/cron-jobs.ts +4 -3
  40. package/src/cron/cron-pr-intake.ts +1 -2
  41. package/src/extension.ts +57 -14
  42. package/src/gateway/gateway-client.ts +14 -12
  43. package/src/group/group-runner.ts +3 -2
  44. package/src/group-runner-extension.ts +7 -3
  45. package/src/host-extension.ts +109 -2
  46. package/src/host-sdk-helper.ts +12 -3
  47. package/src/lane/decision-tool.ts +2 -3
  48. package/src/lane/lane-report.ts +8 -30
  49. package/src/lane/lane-rows.ts +1 -1
  50. package/src/lane/workflow.ts +44 -3
  51. package/src/lane-extension.ts +5 -46
  52. package/src/messaging/discord-context.ts +8 -6
  53. package/src/omp/host-protocol.ts +4 -3
  54. package/src/omp/host.ts +24 -7
  55. package/src/omp/managed-super.ts +43 -27
  56. package/src/omp/native-sessions.ts +12 -0
  57. package/src/omp/worker-memory-import.ts +410 -0
  58. package/src/omp/worker-memory-sdk.ts +8 -0
  59. package/src/operator/setup.ts +8 -13
  60. package/src/operator/stop-lane.ts +25 -0
  61. package/src/pr/pr-github-schema.ts +9 -0
  62. package/src/pr/pr-github.ts +6 -2
  63. package/src/pr/pr-intake-automation.ts +11 -8
  64. package/src/pr/pr-intake-fix.ts +2 -5
  65. package/src/pr/pr-intake-review.ts +7 -7
  66. package/src/routing/topic-history.ts +2 -2
  67. package/src/runtime/controller.ts +444 -408
  68. package/src/runtime/head-recovery.ts +7 -7
  69. package/src/runtime/worker-memory.ts +156 -0
  70. package/src/storage/deferred-routing.ts +1 -7
  71. package/src/storage/store.ts +441 -375
  72. package/src/worker/worker-host.ts +3 -2
  73. package/src/worker/worker-ledger.ts +20 -11
  74. package/src/worker/worker-memory-page.ts +83 -0
  75. package/src/worker/worker-memory-proofs.ts +260 -0
  76. package/src/worker/worker-memory-source.ts +305 -0
  77. package/src/worker/worker-memory-storage.ts +130 -0
  78. package/src/worker/worker-profile.ts +2 -0
  79. package/src/worker/worker-repository.ts +92 -7
  80. package/src/worker/worker-request.ts +1 -0
  81. package/src/worker/worker-service.ts +25 -8
  82. package/src/worker/worker-wire.ts +20 -6
@@ -1,15 +1,15 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { physicalRoute, routeKey, type Inbound, type InputRecord, type Lane, type Route, type StorePort } from "../contracts";
3
3
  import { compareMessageIds } from "../routing/message-order";
4
- import type { CronJobs } from "../cron/cron-jobs";
4
+ import type { CronJobs, CronPrJob } from "../cron/cron-jobs";
5
5
  import type { CronPrCandidate, CronPrIntake } from "../cron/cron-pr-intake";
6
- import type { CronPrJob } from "../cron/cron-jobs";
7
6
  import { hasIntakeReplyRoute, intakeThreadKey, intakeStatusKey, intakeWorkId, intakeWorkPrefix } from "./pr-intake-work";
7
+ import { hasExactJsonPropertyCount } from "./pr-github-schema";
8
8
  import { inspectIntakeMerge, mergeIntakePull } from "./pr-intake-github";
9
9
  import { applyIntakeFix, intakeFixDigest, parseIntakeFix, reconcileIntakeFix } from "./pr-intake-fix";
10
10
  import { readIntakeMaterial, readIntakeMaterialTarget } from "./pr-intake-material";
11
11
  import { inspectIntakeComment, publishIntakeComment } from "./pr-intake-comment";
12
- import { advancePrIntakeAutomation, prIntakeManualHold, readPrIntakeAutomation } from "./pr-intake-automation";
12
+ import { advancePrIntakeAutomation, hasUnresolvedIntakeWrites, prIntakeManualHold, readPrIntakeAutomation } from "./pr-intake-automation";
13
13
  import type { PrIntakeMode } from "./pr-intake-mode";
14
14
 
15
15
  export class PrControlError extends Error {}
@@ -51,7 +51,7 @@ function approved(text: string): boolean {
51
51
  try {
52
52
  const result: unknown = JSON.parse(text);
53
53
  return typeof result === "object" && result !== null && Object.keys(result).length === 2
54
- && [...text.matchAll(/"(?:[^"\\]|\\[\s\S])*"/g)].filter(token => /^\s*:/.test(text.slice(token.index + token[0].length))).length === 2
54
+ && hasExactJsonPropertyCount(text, 2)
55
55
  && "verdict" in result && result.verdict === "approve" && "summary" in result
56
56
  && typeof result.summary === "string" && result.summary.trim().length > 0;
57
57
  } catch { return false; }
@@ -68,7 +68,7 @@ export class PrReviews {
68
68
 
69
69
  needsReconciliation(scope: Pick<ReviewRound, "repositoryId" | "number">): boolean {
70
70
  const state = readPrIntakeAutomation(this.store, scope);
71
- return !!state && [...state.comments, state.fix, state.merge].some(entry => entry?.state === "unknown" || entry?.state === "pending");
71
+ return state !== null && hasUnresolvedIntakeWrites(state);
72
72
  }
73
73
 
74
74
  laneRound(laneId: string): ReviewRound | null {
@@ -209,7 +209,7 @@ export class PrReviews {
209
209
  // after the answer has been sent. It is not a later confirmation.
210
210
  const event = command.messageId ?? command.interactionId;
211
211
  if (!output?.remoteId || !event || compareMessageIds("discord", event, output.remoteId) !== 1) return null;
212
- return digest(JSON.stringify([r.inputId, r.epoch, input?.requestId, input?.generation, output?.remoteId, answer]));
212
+ return digest(JSON.stringify([r.inputId, r.epoch, input?.requestId, input?.generation, output.remoteId, answer]));
213
213
  }
214
214
 
215
215
  private next(r: ReviewRound): string {
@@ -314,7 +314,7 @@ export class PrReviews {
314
314
  return "이전 GitHub 변경을 확인하지 못했습니다. GitHub PR과 커밋 이력을 직접 대조하세요. 이 등록에서는 모호한 쓰기를 다시 보내지 않습니다.";
315
315
  }
316
316
  if (effect?.state === "confirmed") {
317
- if (action === "pr-status" || action !== "pr-review" || effect.action === "pr-merge" || head === previous.head)
317
+ if (action !== "pr-review" || effect.action === "pr-merge" || head === previous.head)
318
318
  return `GitHub 확인: ${effect.action} ${effect.sha}. ${effect.action === "pr-fix" ? `이 스레드에서 /cron pr-review ${jobId} ${number} ${effect.sha} 로 새 HEAD를 다시 검토하세요.` : "종료되었습니다."}`;
319
319
  }
320
320
  if (action === "pr-status") {
@@ -204,7 +204,7 @@ function* excerptWindows(text: string): Iterable<string> {
204
204
  }
205
205
  }
206
206
 
207
- function visibleLine(text: string, limit: number): string {
207
+ function visibleLine(text: string, limit?: number): string {
208
208
  return ownerRoutingProse(text).slice(0, limit).replace(/[\s\p{Cc}\p{Cf}]+/gu, " ").trim();
209
209
  }
210
210
 
@@ -235,7 +235,7 @@ export function pastTopicQuery(text: string): string | null {
235
235
 
236
236
  function routingRequest(text: string) {
237
237
  if (text.length > MAX_QUERY) return null;
238
- const subject = ownerRoutingProse(text).replace(/[\s\p{Cc}\p{Cf}]+/gu, " ").trim();
238
+ const subject = visibleLine(text);
239
239
  // Past-topic aliases treat "fix" as a bug descriptor. In ordinary text an
240
240
  // action alone should not make one otherwise ambiguous term a direct match.
241
241
  const terms = new Set(wordTokens(subject.replace(/\b(?:fix(?:es|ed|ing)?|debug(?:s|ged|ging)?)\b/giu, " "))