@attalabs/vinaya 0.42.1 → 0.43.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.
Files changed (88) hide show
  1. package/dist/checks/bin/check-evidence-fresh.js +177 -152
  2. package/dist/checks/bin/check-registry-gates.js +10 -3
  3. package/dist/index.js +300 -173
  4. package/dist/lib/pre-push-cache-test-run.js +145 -144
  5. package/dist/lib/pre-push-changed-files.js +10 -3
  6. package/dist/lib/pre-push-progress-dir.js +169 -147
  7. package/dist/lib/pre-push-select-tests.js +16 -4
  8. package/dist/lib/push-progress-observer.js +169 -147
  9. package/dist/programs/archive.js +172 -148
  10. package/dist/programs/audit.js +169 -147
  11. package/dist/programs/check.js +172 -148
  12. package/dist/programs/commit-msg.js +172 -148
  13. package/dist/programs/dev-review-loop.js +300 -176
  14. package/dist/programs/dispatch.js +1905 -1877
  15. package/dist/programs/log-emit.js +172 -148
  16. package/dist/programs/log-selftest.js +172 -148
  17. package/dist/programs/log-send.js +172 -148
  18. package/dist/programs/pr-report.js +177 -152
  19. package/dist/programs/pr-snapshot.js +172 -148
  20. package/dist/programs/pr-verify-evidence.js +177 -152
  21. package/dist/programs/pr.js +172 -148
  22. package/dist/programs/review-post.js +172 -148
  23. package/dist/programs/review-status.js +180 -148
  24. package/dist/programs/run-engine.js +110594 -0
  25. package/dist/programs/supervised-command.js +67 -0
  26. package/dist/programs/sync.js +63 -39
  27. package/dist/programs/task-brief.js +174 -150
  28. package/dist/programs/task-sweep.js +244 -151
  29. package/dist/programs/task-tools-serve.js +260 -163
  30. package/dist/programs/tokens.js +172 -148
  31. package/dist/programs/waiver.js +172 -148
  32. package/dist/vinaya-strict/checks/registry.ts +1085 -0
  33. package/dist/vinaya-strict/executing/code-reviewer/README.md +3 -0
  34. package/dist/vinaya-strict/executing/code-reviewer/doctrine.md +185 -0
  35. package/dist/vinaya-strict/executing/code-reviewer/evals/README.md +1 -0
  36. package/dist/vinaya-strict/executing/code-reviewer/evals/code-reviewer-cases.json +280 -0
  37. package/dist/vinaya-strict/executing/code-reviewer/grants.yaml +22 -0
  38. package/dist/vinaya-strict/executing/code-reviewer/output.schema.json +93 -0
  39. package/dist/vinaya-strict/executing/code-reviewer/review-result.ts +347 -0
  40. package/dist/vinaya-strict/executing/dev-review.flow.yaml +103 -0
  41. package/dist/vinaya-strict/executing/developer/README.md +3 -0
  42. package/dist/vinaya-strict/executing/developer/developer-doctrine-shape.test.ts +69 -0
  43. package/dist/vinaya-strict/executing/developer/developer-turn-result.ts +286 -0
  44. package/dist/vinaya-strict/executing/developer/doctrine.md +111 -0
  45. package/dist/vinaya-strict/executing/developer/evals/README.md +1 -0
  46. package/dist/vinaya-strict/executing/developer/evals/developer-capability-cases.json +6275 -0
  47. package/dist/vinaya-strict/executing/developer/evals/developer-capability-held-out.json +11526 -0
  48. package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.test.ts +498 -0
  49. package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.ts +1407 -0
  50. package/dist/vinaya-strict/executing/developer/grants.yaml +25 -0
  51. package/dist/vinaya-strict/executing/developer/output.schema.json +148 -0
  52. package/dist/vinaya-strict/executing/developer/reference.md +376 -0
  53. package/dist/vinaya-strict/executing/operator/doctrine.md +209 -0
  54. package/dist/vinaya-strict/executing/security-reviewer/README.md +3 -0
  55. package/dist/vinaya-strict/executing/security-reviewer/doctrine.md +171 -0
  56. package/dist/vinaya-strict/executing/security-reviewer/evals/README.md +1 -0
  57. package/dist/vinaya-strict/executing/security-reviewer/evals/security-reviewer-cases.json +141 -0
  58. package/dist/vinaya-strict/executing/security-reviewer/grants.yaml +22 -0
  59. package/dist/vinaya-strict/executing/security-reviewer/output.schema.json +93 -0
  60. package/dist/vinaya-strict/integration/config/vinaya-config-section.ts +1278 -0
  61. package/dist/vinaya-strict/integration/policies/vinaya-policies.ts +52 -0
  62. package/dist/vinaya-strict/integration/process/process-integration.ts +57 -0
  63. package/dist/vinaya-strict/loops/dev-review/v2/dev-review-v2.flow.yaml +136 -0
  64. package/dist/vinaya-strict/process.yaml +43 -0
  65. package/dist/vinaya-strict/retrospecting/archivist/doctrine.md +174 -0
  66. package/dist/vinaya-strict/retrospecting/tranche-archivist/doctrine.md +270 -0
  67. package/dist/vinaya-strict/thinking/architect/doctrine.md +110 -0
  68. package/dist/vinaya-strict/thinking/planner/doctrine.md +105 -0
  69. package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.test.ts +128 -0
  70. package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.ts +169 -0
  71. package/dist/vinaya-strict/thinking/planner/tools/open-issue.test.ts +701 -0
  72. package/dist/vinaya-strict/thinking/planner/tools/open-issue.ts +1035 -0
  73. package/dist/vinaya-strict/thinking/planner/tools/planner-operations.test.ts +359 -0
  74. package/dist/vinaya-strict/thinking/planner/tools/planner-operations.ts +815 -0
  75. package/dist/vinaya-strict/thinking/planner/tools/planner-tools.test.ts +200 -0
  76. package/dist/vinaya-strict/thinking/planner/tools/planner-tools.ts +458 -0
  77. package/package.json +4 -2
  78. package/studio-standalone/apps/vinaya-studio/.next/BUILD_ID +1 -1
  79. package/studio-standalone/apps/vinaya-studio/.next/build-manifest.json +2 -2
  80. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.html +1 -1
  81. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.rsc +1 -1
  82. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  83. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  84. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  85. package/studio-standalone/apps/vinaya-studio/.next/server/middleware-build-manifest.js +1 -1
  86. package/studio-standalone/apps/vinaya-studio/.next/server/pages/500.html +1 -1
  87. /package/studio-standalone/apps/vinaya-studio/.next/static/{yFfoujElgbwPk-7KNS-kw → x2q88XfwsihlevulRhIvs}/_buildManifest.js +0 -0
  88. /package/studio-standalone/apps/vinaya-studio/.next/static/{yFfoujElgbwPk-7KNS-kw → x2q88XfwsihlevulRhIvs}/_ssgManifest.js +0 -0
@@ -2427,6 +2427,138 @@ var init_fetch_documentation = __esm(() => {
2427
2427
  };
2428
2428
  });
2429
2429
 
2430
+ // ../../harness/kernel/log/roles.ts
2431
+ function registerRole(name, role) {
2432
+ roles.set(name, role);
2433
+ }
2434
+ function registerTitle(name, title) {
2435
+ titles.set(name, title);
2436
+ }
2437
+ function isRole(value) {
2438
+ return value !== undefined && roles.has(value);
2439
+ }
2440
+ function lookupRole(name) {
2441
+ return roles.get(name);
2442
+ }
2443
+ function lookupTitle(name) {
2444
+ return roles.get(name)?.title ?? titles.get(name);
2445
+ }
2446
+ var roles, titles;
2447
+ var init_roles = __esm(() => {
2448
+ roles = new Map;
2449
+ titles = new Map;
2450
+ });
2451
+
2452
+ // ../../harness/kernel/log/envelope.ts
2453
+ import { createHash as createHash2 } from "node:crypto";
2454
+ function actorIdFromEnv(role) {
2455
+ return role === undefined || role === "" ? null : role;
2456
+ }
2457
+ function lineageFieldFromEnv(value) {
2458
+ return value === undefined || value === "" ? null : value;
2459
+ }
2460
+ function attemptFromEnv(value) {
2461
+ if (value === undefined || value === "")
2462
+ return null;
2463
+ const n = Number(value);
2464
+ return Number.isInteger(n) ? n : null;
2465
+ }
2466
+ function provenanceFor(input) {
2467
+ if (input.provenance)
2468
+ return input.provenance;
2469
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
2470
+ return "unavailable";
2471
+ if (input.env.role || input.env.task)
2472
+ return "env_correlated";
2473
+ return "unavailable";
2474
+ }
2475
+ function issueFromTask(task) {
2476
+ if (task === undefined || task === "")
2477
+ return null;
2478
+ const n = Number(task);
2479
+ return Number.isInteger(n) ? n : null;
2480
+ }
2481
+ function roundFromEnv(round) {
2482
+ if (round === undefined || round === "")
2483
+ return;
2484
+ const n = Number(round);
2485
+ return Number.isInteger(n) ? n : undefined;
2486
+ }
2487
+ function prFromEnv(pr) {
2488
+ if (pr === undefined || pr === "")
2489
+ return;
2490
+ const n = Number(pr);
2491
+ return Number.isInteger(n) && n > 0 ? n : undefined;
2492
+ }
2493
+ function buildHeader(input) {
2494
+ const role = isRole(input.env.role) ? input.env.role : "unattributed";
2495
+ const round = roundFromEnv(input.env.round);
2496
+ const pr = prFromEnv(input.env.pr);
2497
+ const subject = {
2498
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
2499
+ role,
2500
+ ...round !== undefined ? { round } : {},
2501
+ ...pr !== undefined ? { pr } : {},
2502
+ ...input.subject ?? {}
2503
+ };
2504
+ const issue = subject.issue;
2505
+ return {
2506
+ meta: {
2507
+ schema: 4,
2508
+ ts: input.now.toISOString(),
2509
+ run_id: input.runId,
2510
+ seq: input.seq,
2511
+ repo: input.repo,
2512
+ vinaya: input.vinaya,
2513
+ doctrine: input.doctrine,
2514
+ host: input.host,
2515
+ machine: createHash2("sha256").update(input.hostname).digest("hex"),
2516
+ event_id: input.eventId,
2517
+ process_id: input.processId,
2518
+ actor_id: actorIdFromEnv(input.env.role),
2519
+ lineage: {
2520
+ run: lineageFieldFromEnv(input.env.run),
2521
+ attempt: attemptFromEnv(input.env.attempt),
2522
+ parent: lineageFieldFromEnv(input.env.parent)
2523
+ },
2524
+ input_versions: {
2525
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
2526
+ objectives_version: input.inputVersions?.objectivesVersion ?? null,
2527
+ brief_hash: input.inputVersions?.briefHash ?? null,
2528
+ ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
2529
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
2530
+ policy_digest: input.inputVersions?.policyDigest ?? null
2531
+ },
2532
+ provenance: provenanceFor(input),
2533
+ work: {
2534
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
2535
+ repo: input.repo,
2536
+ change: pr === undefined ? null : String(pr),
2537
+ revision: input.revision ?? null
2538
+ },
2539
+ flow: {
2540
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
2541
+ version: lineageFieldFromEnv(input.env.flowVersion)
2542
+ },
2543
+ runtime: lineageFieldFromEnv(input.env.runtime),
2544
+ process: {
2545
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
2546
+ version: lineageFieldFromEnv(input.env.processVersion),
2547
+ digest: lineageFieldFromEnv(input.env.processDigest)
2548
+ },
2549
+ runner: {
2550
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
2551
+ version: lineageFieldFromEnv(input.env.runnerVersion)
2552
+ },
2553
+ source: lineageFieldFromEnv(input.env.source)
2554
+ },
2555
+ subject
2556
+ };
2557
+ }
2558
+ var init_envelope = __esm(() => {
2559
+ init_roles();
2560
+ });
2561
+
2430
2562
  // ../../harness/kernel/log/custom.ts
2431
2563
  import { z as z3 } from "zod";
2432
2564
  var CUSTOM_EVENT_NAME_PATTERN, CUSTOM_EVENT_NAME_MAX_LENGTH = 64, CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya", CUSTOM_EVENT_MAX_FIELDS = 20, CUSTOM_FIELD_NAME_PATTERN, CUSTOM_FIELD_NAME_MAX_LENGTH = 64, CUSTOM_TEXT_MAX_LENGTH = 500, CUSTOM_WORD_PATTERN, CUSTOM_WORD_MAX_LENGTH = 64, CUSTOM_FIELD_MAX_WORDS = 50, CustomFieldTypeSchema, CustomEventDeclarationsSchema;
@@ -2484,19 +2616,11 @@ var init_custom = __esm(() => {
2484
2616
 
2485
2617
  // ../../harness/kernel/log/schema.ts
2486
2618
  import { z as z4 } from "zod";
2487
- var CONFIDENCE_REASON_MAX_LENGTH = 280, REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000, ROLE_VALUES, RoleSchema, HOST_VALUES, HostSchema, RUN_ID_PATTERN, headerMetaCore, HeaderMetaV1Schema, LineageSchema, InputVersionsSchema, ProvenanceSchema, HeaderMetaV2Schema, WorkSchema, FlowSchema, HeaderMetaV3Schema, HeaderMetaV4Schema, HeaderMetaSchema, SubjectSchema, HeaderSchema, envelopeTail, ReviewFindingSchema, DispatchOutcomeSchema, dispatchShared, dispatchUsageField, DispatchEventSchema, CODE_TOKEN_PATTERN, CodeTokenSchema, ReviewerVerdictSchema, loopShared, DevReviewLoopEventSchema, ForgeOpSchema, ForgeWriteTargetSchema, forgeWriteShared, ForgeWriteEventSchema, GateOutcomeSchema, gateShared, GateEventSchema, OperationResultSchema, operationShared, OperationEventSchema, UsageUnitsSchema, usageShared, UsageEventSchema, RoleAttemptOutcomeSchema, roleAttemptShared, RoleAttemptEventSchema, handoffShared, HandoffEventSchema, EffectTargetSchema, effectShared, EffectEventSchema, CustomFieldValueSchema, customShared, CustomEventSchema, LogEventSchema;
2619
+ var CONFIDENCE_REASON_MAX_LENGTH = 280, REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000, ROLE_NAME_PATTERN, RoleSchema, HOST_VALUES, HostSchema, RUN_ID_PATTERN, headerMetaCore, HeaderMetaV1Schema, LineageSchema, InputVersionsSchema, ProvenanceSchema, HeaderMetaV2Schema, WorkSchema, FlowSchema, HeaderMetaV3Schema, HeaderMetaV4Schema, HeaderMetaSchema, SubjectSchema, HeaderSchema, envelopeTail, ReviewFindingSchema, DispatchOutcomeSchema, dispatchShared, dispatchUsageField, DispatchEventSchema, CODE_TOKEN_PATTERN, CodeTokenSchema, ReviewerVerdictSchema, loopShared, DevReviewLoopEventSchema, ForgeOpSchema, ForgeWriteTargetSchema, forgeWriteShared, ForgeWriteEventSchema, GateOutcomeSchema, gateShared, GateEventSchema, OperationResultSchema, operationShared, OperationEventSchema, UsageUnitsSchema, usageShared, UsageEventSchema, RoleAttemptOutcomeSchema, roleAttemptShared, RoleAttemptEventSchema, handoffShared, HandoffEventSchema, EffectTargetSchema, effectShared, EffectEventSchema, CustomFieldValueSchema, customShared, CustomEventSchema, LogEventSchema;
2488
2620
  var init_schema = __esm(() => {
2489
2621
  init_custom();
2490
- ROLE_VALUES = [
2491
- "planner",
2492
- "developer",
2493
- "code-reviewer",
2494
- "security",
2495
- "principal",
2496
- "archivist",
2497
- "architect"
2498
- ];
2499
- RoleSchema = z4.enum(ROLE_VALUES);
2622
+ ROLE_NAME_PATTERN = /^[a-z0-9-]+$/;
2623
+ RoleSchema = z4.string().regex(ROLE_NAME_PATTERN);
2500
2624
  HOST_VALUES = ["hook", "ci", "cli", "loop"];
2501
2625
  HostSchema = z4.enum(HOST_VALUES);
2502
2626
  RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
@@ -3078,119 +3202,6 @@ var init_schema = __esm(() => {
3078
3202
  ]);
3079
3203
  });
3080
3204
 
3081
- // ../../harness/kernel/log/envelope.ts
3082
- import { createHash as createHash2 } from "node:crypto";
3083
- function isRole(value) {
3084
- return value !== undefined && ROLE_VALUES.includes(value);
3085
- }
3086
- function actorIdFromEnv(role) {
3087
- return role === undefined || role === "" ? null : role;
3088
- }
3089
- function lineageFieldFromEnv(value) {
3090
- return value === undefined || value === "" ? null : value;
3091
- }
3092
- function attemptFromEnv(value) {
3093
- if (value === undefined || value === "")
3094
- return null;
3095
- const n = Number(value);
3096
- return Number.isInteger(n) ? n : null;
3097
- }
3098
- function provenanceFor(input) {
3099
- if (input.provenance)
3100
- return input.provenance;
3101
- if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
3102
- return "unavailable";
3103
- if (input.env.role || input.env.task)
3104
- return "env_correlated";
3105
- return "unavailable";
3106
- }
3107
- function issueFromTask(task) {
3108
- if (task === undefined || task === "")
3109
- return null;
3110
- const n = Number(task);
3111
- return Number.isInteger(n) ? n : null;
3112
- }
3113
- function roundFromEnv(round) {
3114
- if (round === undefined || round === "")
3115
- return;
3116
- const n = Number(round);
3117
- return Number.isInteger(n) ? n : undefined;
3118
- }
3119
- function prFromEnv(pr) {
3120
- if (pr === undefined || pr === "")
3121
- return;
3122
- const n = Number(pr);
3123
- return Number.isInteger(n) && n > 0 ? n : undefined;
3124
- }
3125
- function buildHeader(input) {
3126
- const role = isRole(input.env.role) ? input.env.role : "unattributed";
3127
- const round = roundFromEnv(input.env.round);
3128
- const pr = prFromEnv(input.env.pr);
3129
- const subject = {
3130
- issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
3131
- role,
3132
- ...round !== undefined ? { round } : {},
3133
- ...pr !== undefined ? { pr } : {},
3134
- ...input.subject ?? {}
3135
- };
3136
- const issue = subject.issue;
3137
- return {
3138
- meta: {
3139
- schema: 4,
3140
- ts: input.now.toISOString(),
3141
- run_id: input.runId,
3142
- seq: input.seq,
3143
- repo: input.repo,
3144
- vinaya: input.vinaya,
3145
- doctrine: input.doctrine,
3146
- host: input.host,
3147
- machine: createHash2("sha256").update(input.hostname).digest("hex"),
3148
- event_id: input.eventId,
3149
- process_id: input.processId,
3150
- actor_id: actorIdFromEnv(input.env.role),
3151
- lineage: {
3152
- run: lineageFieldFromEnv(input.env.run),
3153
- attempt: attemptFromEnv(input.env.attempt),
3154
- parent: lineageFieldFromEnv(input.env.parent)
3155
- },
3156
- input_versions: {
3157
- manifest_version: input.inputVersions?.manifestVersion ?? null,
3158
- objectives_version: input.inputVersions?.objectivesVersion ?? null,
3159
- brief_hash: input.inputVersions?.briefHash ?? null,
3160
- ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
3161
- pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
3162
- policy_digest: input.inputVersions?.policyDigest ?? null
3163
- },
3164
- provenance: provenanceFor(input),
3165
- work: {
3166
- ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
3167
- repo: input.repo,
3168
- change: pr === undefined ? null : String(pr),
3169
- revision: input.revision ?? null
3170
- },
3171
- flow: {
3172
- id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
3173
- version: lineageFieldFromEnv(input.env.flowVersion)
3174
- },
3175
- runtime: lineageFieldFromEnv(input.env.runtime),
3176
- process: {
3177
- id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
3178
- version: lineageFieldFromEnv(input.env.processVersion),
3179
- digest: lineageFieldFromEnv(input.env.processDigest)
3180
- },
3181
- runner: {
3182
- id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
3183
- version: lineageFieldFromEnv(input.env.runnerVersion)
3184
- },
3185
- source: lineageFieldFromEnv(input.env.source)
3186
- },
3187
- subject
3188
- };
3189
- }
3190
- var init_envelope = __esm(() => {
3191
- init_schema();
3192
- });
3193
-
3194
3205
  // ../../harness/kernel/log/store.ts
3195
3206
  function metaOf(obj) {
3196
3207
  if (obj === null || typeof obj !== "object")
@@ -3296,7 +3307,8 @@ function code(value) {
3296
3307
  return typeof value === "string" && CODE_TOKEN_PATTERN.test(value) ? value : null;
3297
3308
  }
3298
3309
  function roleSubject(value, sentenceStart = true) {
3299
- const name = typeof value === "string" && ROLE_VALUES.includes(value) ? `the ${value === "security" ? "security reviewer" : value.replace(/-/g, " ")}` : "a role";
3310
+ const known = typeof value === "string" ? lookupRole(value) : undefined;
3311
+ const name = known ? `the ${known.reading}` : "a role";
3300
3312
  return sentenceStart ? `${name[0]?.toUpperCase()}${name.slice(1)}` : name;
3301
3313
  }
3302
3314
  function roundLabel(record) {
@@ -3415,7 +3427,7 @@ function conflictReentry(record) {
3415
3427
  function dispatched(record) {
3416
3428
  const role = text(record.target_role);
3417
3429
  const who = roleSubject(role);
3418
- const reviewing = role === "code-reviewer" || role === "security";
3430
+ const reviewing = role !== null && (lookupRole(role)?.reviews ?? false);
3419
3431
  const round = whole(record.round);
3420
3432
  return {
3421
3433
  kind: "working",
@@ -3474,6 +3486,7 @@ function narrate(record, earlier = []) {
3474
3486
  }
3475
3487
  var REASONS, PAUSE_WITHOUT_CODE;
3476
3488
  var init_narration = __esm(() => {
3489
+ init_roles();
3477
3490
  init_schema();
3478
3491
  REASONS = {
3479
3492
  escalation: { words: "a role escalated a question", person: true },
@@ -3506,13 +3519,7 @@ var init_narration = __esm(() => {
3506
3519
 
3507
3520
  // ../../harness/kernel/adapters/agents/agent-line.ts
3508
3521
  function roleLabel(role) {
3509
- if (role in roleLabels)
3510
- return roleLabels[role];
3511
- if (role === "dev-review-loop")
3512
- return "Loop";
3513
- if (role === "operator")
3514
- return "Operator";
3515
- return role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
3522
+ return lookupTitle(role) ?? role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
3516
3523
  }
3517
3524
  function logQuiet(env = process.env) {
3518
3525
  return env.VINAYA_LOG_QUIET === "1" || env.VINAYA_LOG_QUIET === "true";
@@ -3580,17 +3587,9 @@ function renderNarratedUpdate(update) {
3580
3587
  ...call
3581
3588
  };
3582
3589
  }
3583
- var roleLabels, unicodeMarks, asciiMarks, META_KEY, META_VALUE, actionVerbs, resultVerbs;
3590
+ var unicodeMarks, asciiMarks, META_KEY, META_VALUE, actionVerbs, resultVerbs;
3584
3591
  var init_agent_line = __esm(() => {
3585
- roleLabels = {
3586
- planner: "Planner",
3587
- developer: "Developer",
3588
- "code-reviewer": "Code review",
3589
- security: "Security",
3590
- principal: "Principal",
3591
- archivist: "Archivist",
3592
- architect: "Architect"
3593
- };
3592
+ init_roles();
3594
3593
  unicodeMarks = { working: "▸", done: "✓", failed: "✕", waiting: "◌", round: "◆" };
3595
3594
  asciiMarks = { working: ">", done: "+", failed: "x", waiting: "~", round: "#" };
3596
3595
  META_KEY = /^[a-z]+$/;
@@ -4922,6 +4921,28 @@ function cliPackageRoot() {
4922
4921
  }
4923
4922
  var init_package_root = () => {};
4924
4923
 
4924
+ // ../../harness/processes/vinaya-strict/integration/log/log-roles.ts
4925
+ function registerVinayaLogRoles() {
4926
+ for (const { name, reading, title, reviews } of VINAYA_LOG_ROLES)
4927
+ registerRole(name, { reading, title, reviews });
4928
+ registerTitle("dev-review-loop", "Loop");
4929
+ }
4930
+ var VINAYA_LOG_ROLES, VINAYA_LOG_ROLE_NAMES;
4931
+ var init_log_roles = __esm(() => {
4932
+ init_roles();
4933
+ VINAYA_LOG_ROLES = [
4934
+ { name: "planner", reading: "planner", title: "Planner", reviews: false },
4935
+ { name: "developer", reading: "developer", title: "Developer", reviews: false },
4936
+ { name: "code-reviewer", reading: "code reviewer", title: "Code review", reviews: true },
4937
+ { name: "security", reading: "security reviewer", title: "Security", reviews: true },
4938
+ { name: "principal", reading: "principal", title: "Principal", reviews: false },
4939
+ { name: "archivist", reading: "archivist", title: "Archivist", reviews: false },
4940
+ { name: "architect", reading: "architect", title: "Architect", reviews: false }
4941
+ ];
4942
+ VINAYA_LOG_ROLE_NAMES = VINAYA_LOG_ROLES.map((role) => role.name);
4943
+ registerVinayaLogRoles();
4944
+ });
4945
+
4925
4946
  // ../../harness/kernel/adapters/code-host/github/gh.ts
4926
4947
  import { execFile as execFile3, execFileSync as execFileSync3 } from "node:child_process";
4927
4948
  import { promisify as promisify3 } from "node:util";
@@ -5656,6 +5677,7 @@ function installVinayaLogSinkFactory() {
5656
5677
  var init_log_sink_factory = __esm(() => {
5657
5678
  init_log_sink();
5658
5679
  init_package_root();
5680
+ init_log_roles();
5659
5681
  init_branch_issue();
5660
5682
  init_doctrine_version();
5661
5683
  });
@@ -12705,6 +12727,10 @@ function colourLoopLine(line, stream) {
12705
12727
  function isAgentVendor(value) {
12706
12728
  return AGENT_VENDOR_NAMES.includes(value);
12707
12729
  }
12730
+ function realCeilingTimer(fire, timeoutMs) {
12731
+ const timer = setTimeout(fire, timeoutMs);
12732
+ return () => clearTimeout(timer);
12733
+ }
12708
12734
  function addCodexWritableDirs(args, extraWritableDirs, resumed, developerFiles = []) {
12709
12735
  const requestedDirs = [...extraWritableDirs, ...developerFiles.map((file) => dirname13(file))];
12710
12736
  if (requestedDirs.length === 0)
@@ -13916,14 +13942,14 @@ function terminateChildWithGrace(pid, graceMs = TERMINATE_GRACE_MS) {
13916
13942
  } catch {}
13917
13943
  }
13918
13944
  }
13919
- function captureSettledChildSnapshot(pid) {
13920
- let snapshot = getProcessSnapshot(pid);
13945
+ function captureSettledChildSnapshot(pid, readSnapshot = getProcessSnapshot) {
13946
+ let snapshot = readSnapshot(pid);
13921
13947
  if (snapshot === null)
13922
13948
  return null;
13923
13949
  const deadline = Date.now() + IDENTITY_SETTLE_BUDGET_MS;
13924
13950
  while (Date.now() < deadline) {
13925
13951
  sleepSyncMs2(IDENTITY_SETTLE_POLL_MS);
13926
- const next = getProcessSnapshot(pid);
13952
+ const next = readSnapshot(pid);
13927
13953
  if (next === null)
13928
13954
  return snapshot;
13929
13955
  if (next.command === snapshot.command)
@@ -14892,7 +14918,7 @@ ${agentControlsError}` : sandboxProbeError !== null ? `[vinaya dispatch ${effect
14892
14918
  const warnTimer = setTimeout(() => {
14893
14919
  writeLifecycle(`[vinaya dispatch ${effectId}] ${role} via ${agent}: approaching timeout — SIGTERM in ~${Math.round(warnLeadMs / 1000)}s unless it finishes first`);
14894
14920
  }, Math.max(timeoutMs - warnLeadMs, 0));
14895
- const timeoutTimer = setTimeout(() => {
14921
+ const disarmCeiling = (opts.armCeiling ?? realCeilingTimer)(() => {
14896
14922
  timedOut = true;
14897
14923
  writeLifecycle(`[vinaya dispatch ${effectId}] ${role} via ${agent}: ceiling reached — sending SIGTERM`);
14898
14924
  child.kill("SIGTERM");
@@ -14928,7 +14954,7 @@ ${agentControlsError}` : sandboxProbeError !== null ? `[vinaya dispatch ${effect
14928
14954
  if (settled)
14929
14955
  return;
14930
14956
  settled = true;
14931
- clearTimeout(timeoutTimer);
14957
+ disarmCeiling();
14932
14958
  if (killTimer)
14933
14959
  clearTimeout(killTimer);
14934
14960
  clearTimeout(firstWaitTimer);
@@ -15512,11 +15538,12 @@ function lookup2(name) {
15512
15538
  throw new Error(`no program named '${name}' — the program table names: ${[...PROGRAMS.keys()].join(", ")}`);
15513
15539
  return found;
15514
15540
  }
15515
- function programFile(name) {
15541
+ function programFile(name, packageRoot = cliPackageRoot(), fromSource = FROM_SOURCE) {
15516
15542
  const entry = lookup2(name);
15517
- const built = join23(cliPackageRoot(), entry.built);
15518
- const source = join23(SOURCE_ROOT, entry.source);
15519
- if (FROM_SOURCE && existsSync19(source))
15543
+ return pickFile(join23(packageRoot, entry.built), join23(SOURCE_ROOT, entry.source), fromSource);
15544
+ }
15545
+ function pickFile(built, source, fromSource) {
15546
+ if (fromSource && existsSync19(source))
15520
15547
  return source;
15521
15548
  return existsSync19(built) ? built : source;
15522
15549
  }
@@ -15590,7 +15617,9 @@ var init_programs = __esm(() => {
15590
15617
  program("log-selftest", `${P}/integration/bin/log-selftest.ts`, "dist/programs/log-selftest.js", [
15591
15618
  words("log", "selftest")
15592
15619
  ]),
15593
- program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")])
15620
+ program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")]),
15621
+ program("run-engine", `${P}/bin/run-engine.ts`, "dist/programs/run-engine.js"),
15622
+ program("supervised-command", `${P}/loops/dev-review/v2/supervised-command.ts`, "dist/programs/supervised-command.js")
15594
15623
  ]);
15595
15624
  SOURCE_ROOT = join23(dirname15(fileURLToPath4(import.meta.url)), "..", "..", "..", "..");
15596
15625
  FROM_SOURCE = fileURLToPath4(import.meta.url).endsWith(".ts");
@@ -15698,8 +15727,8 @@ var init_protected_paths2 = __esm(() => {
15698
15727
 
15699
15728
  // ../../harness/processes/vinaya-strict/integration/policies/roles.ts
15700
15729
  var GRANTED_ROLES, ROLE_TOOL_GRANTS, VINAYA_TOOL_GRANTS, VINAYA_BROKER_ROLES, VINAYA_BOUNDARY_ROLES, OPERATOR_TOOL_GRANT, VINAYA_ROUTER_ROLES;
15701
- var init_roles = __esm(() => {
15702
- init_schema();
15730
+ var init_roles2 = __esm(() => {
15731
+ init_log_roles();
15703
15732
  GRANTED_ROLES = ["developer", "code-reviewer", "security", "controller"];
15704
15733
  ROLE_TOOL_GRANTS = {
15705
15734
  developer: [
@@ -15718,7 +15747,7 @@ var init_roles = __esm(() => {
15718
15747
  };
15719
15748
  VINAYA_TOOL_GRANTS = { roles: GRANTED_ROLES, grants: ROLE_TOOL_GRANTS };
15720
15749
  VINAYA_BROKER_ROLES = {
15721
- recognizedRoles: ROLE_VALUES,
15750
+ recognizedRoles: VINAYA_LOG_ROLE_NAMES,
15722
15751
  workerRoles: ["developer"],
15723
15752
  surfaceOwner: "the Planner"
15724
15753
  };
@@ -15997,7 +16026,7 @@ function vinayaRouterPolicies() {
15997
16026
  var init_vinaya_policies = __esm(() => {
15998
16027
  init_launch_records();
15999
16028
  init_protected_paths2();
16000
- init_roles();
16029
+ init_roles2();
16001
16030
  init_scratch_names();
16002
16031
  });
16003
16032
 
@@ -21563,6 +21592,74 @@ function reassertPrBodyPremise(prBody, fileReader = defaultFileReader) {
21563
21592
 
21564
21593
  // ../../harness/processes/vinaya-strict/loops/dev-review/standalone/dev-review-loop/gate-reading.ts
21565
21594
  init_round_assess();
21595
+
21596
+ // ../../harness/processes/vinaya-strict/loops/dev-review/v2/git-read-memo.ts
21597
+ import { resolve as resolve6 } from "node:path";
21598
+ var MEMOIZED = new Set(["rev-parse", "merge-base", "show-ref", "for-each-ref", "rev-list"]);
21599
+ var READ_ONLY_UNKEPT = new Set(["ls-remote", "status", "diff", "ls-files", "log", "show", "cat-file", "merge-tree"]);
21600
+ var state = { scopes: 0, turns: 0, entries: new Map, listeners: new Set };
21601
+ var memoEnabled = true;
21602
+ var notify = (event) => {
21603
+ for (const listener of state.listeners)
21604
+ listener(event);
21605
+ };
21606
+ function gitSubcommand(args) {
21607
+ for (let i = 0;i < args.length; i++) {
21608
+ const arg = args[i];
21609
+ if (arg === "-C" || arg === "-c" || arg === "--git-dir" || arg === "--work-tree") {
21610
+ i++;
21611
+ continue;
21612
+ }
21613
+ if (arg.startsWith("-"))
21614
+ continue;
21615
+ return arg;
21616
+ }
21617
+ return;
21618
+ }
21619
+ function gitReadKey(cwd, args) {
21620
+ return [resolve6(cwd ?? process.cwd()), ...args].join("\x00");
21621
+ }
21622
+ function gitReadMemoServing() {
21623
+ return memoEnabled && state.scopes > 0 && state.turns === 0;
21624
+ }
21625
+ function clearGitReadMemo(reason = "cleared") {
21626
+ state.entries.clear();
21627
+ notify({ kind: "clear", reason });
21628
+ }
21629
+ function runGit(cwd, args, run) {
21630
+ const sub = gitSubcommand(args);
21631
+ const key = gitReadKey(cwd, args);
21632
+ const memoizable = sub !== undefined && MEMOIZED.has(sub);
21633
+ if (memoizable && gitReadMemoServing()) {
21634
+ const kept = state.entries.get(key);
21635
+ if (kept !== undefined) {
21636
+ notify({ kind: "hit", key });
21637
+ return kept;
21638
+ }
21639
+ let value;
21640
+ try {
21641
+ value = run();
21642
+ } catch (error) {
21643
+ notify({ kind: "spawn", key, memoizable: true, served: false });
21644
+ throw error;
21645
+ }
21646
+ notify({ kind: "spawn", key, memoizable: true, served: true });
21647
+ if (gitReadMemoServing())
21648
+ state.entries.set(key, value);
21649
+ return value;
21650
+ }
21651
+ notify({ kind: "spawn", key, memoizable, served: false });
21652
+ if (memoizable || sub !== undefined && READ_ONLY_UNKEPT.has(sub))
21653
+ return run();
21654
+ try {
21655
+ return run();
21656
+ } finally {
21657
+ clearGitReadMemo(`git ${sub ?? "(none)"}`);
21658
+ }
21659
+ }
21660
+ var wrapped = new WeakMap;
21661
+
21662
+ // ../../harness/processes/vinaya-strict/loops/dev-review/standalone/dev-review-loop/gate-reading.ts
21566
21663
  function shEnvOverride(name, fallback) {
21567
21664
  const raw = process.env[name];
21568
21665
  if (!raw)
@@ -21578,11 +21675,12 @@ function sleepSyncMs4(ms) {
21578
21675
  }
21579
21676
  function sh(cmd, args, options = {}) {
21580
21677
  if (cmd !== "gh") {
21581
- return execFileSync18(cmd, args, {
21678
+ const run = () => execFileSync18(cmd, args, {
21582
21679
  encoding: "utf8",
21583
21680
  stdio: ["ignore", "pipe", "pipe"],
21584
21681
  maxBuffer: MAX_GH_OUTPUT_BYTES
21585
21682
  }).trim();
21683
+ return cmd === "git" ? runGit(undefined, args, run) : run();
21586
21684
  }
21587
21685
  const attempts = options.attempts ?? shEnvOverride("VINAYA_DEV_REVIEW_LOOP_GH_RETRY_ATTEMPTS", 3);
21588
21686
  const backoffMs = shEnvOverride("VINAYA_DEV_REVIEW_LOOP_GH_RETRY_BACKOFF_MS", 500);
@@ -21870,7 +21968,9 @@ function fetchConflictingFiles(baseBranch, headBranch) {
21870
21968
  execFileSync18("git", ["fetch", "--quiet", "origin", baseBranch, headBranch], {
21871
21969
  stdio: ["ignore", "ignore", "ignore"]
21872
21970
  });
21873
- } catch {}
21971
+ } catch {} finally {
21972
+ clearGitReadMemo("git fetch");
21973
+ }
21874
21974
  try {
21875
21975
  execFileSync18("git", ["merge-tree", "--write-tree", `origin/${baseBranch}`, `origin/${headBranch}`], {
21876
21976
  encoding: "utf8",
@@ -22474,7 +22574,7 @@ init_enforcement_controls();
22474
22574
  // ../../harness/kernel/gates/local-gate-control.ts
22475
22575
  import { execFileSync as execFileSync20 } from "node:child_process";
22476
22576
  import { existsSync as existsSync28, readFileSync as readFileSync29, realpathSync as realpathSync8, statSync as statSync9 } from "node:fs";
22477
- import { dirname as dirname21, isAbsolute as isAbsolute4, join as join34, resolve as resolve6 } from "node:path";
22577
+ import { dirname as dirname21, isAbsolute as isAbsolute4, join as join34, resolve as resolve7 } from "node:path";
22478
22578
 
22479
22579
  // ../../harness/kernel/connectors/git/detect.ts
22480
22580
  import { execFile as execFile10, execFileSync as execFileSync19 } from "node:child_process";
@@ -22678,7 +22778,7 @@ function repairLocalGateControl(directory, onRepair = () => {}) {
22678
22778
  let ownFolder = value === null;
22679
22779
  if (value !== null) {
22680
22780
  try {
22681
- ownFolder = realpathSync8(resolve6(root, value)) === realpathSync8(join34(root, TRACKED_HOOK_DIR));
22781
+ ownFolder = realpathSync8(resolve7(root, value)) === realpathSync8(join34(root, TRACKED_HOOK_DIR));
22682
22782
  } catch {
22683
22783
  ownFolder = false;
22684
22784
  }
@@ -23641,7 +23741,7 @@ import { rmSync as rmSync11 } from "node:fs";
23641
23741
  init_schema();
23642
23742
  import { z as z11 } from "zod";
23643
23743
  import { existsSync as existsSync31 } from "node:fs";
23644
- import { resolve as resolve7 } from "node:path";
23744
+ import { resolve as resolve8 } from "node:path";
23645
23745
  import { spawnSync as spawnSync3 } from "node:child_process";
23646
23746
 
23647
23747
  // ../../harness/processes/vinaya-strict/loops/dev-review/actions/live-developer-context.ts
@@ -25761,8 +25861,10 @@ function defaultGitRevParseOriginMain() {
25761
25861
  }
25762
25862
  function defaultGitIsAncestor(ancestor, descendant) {
25763
25863
  try {
25764
- execFileSync22("git", ["merge-base", "--is-ancestor", ancestor, descendant], {
25765
- stdio: ["ignore", "ignore", "ignore"]
25864
+ const args = ["merge-base", "--is-ancestor", ancestor, descendant];
25865
+ runGit(undefined, args, () => {
25866
+ execFileSync22("git", args, { stdio: ["ignore", "ignore", "ignore"] });
25867
+ return "";
25766
25868
  });
25767
25869
  return true;
25768
25870
  } catch (err) {
@@ -25772,12 +25874,14 @@ function defaultGitIsAncestor(ancestor, descendant) {
25772
25874
  }
25773
25875
  }
25774
25876
  function defaultGitMergeBase(head) {
25775
- return resolveMergeBase(head);
25877
+ return resolveMergeBase(head).finally(() => clearGitReadMemo("merge-base resolution"));
25776
25878
  }
25777
25879
  function defaultGitFetch(sha) {
25778
25880
  try {
25779
25881
  execFileSync22("git", ["fetch", "--quiet", "origin", sha], { stdio: ["ignore", "ignore", "ignore"] });
25780
- } catch {}
25882
+ } catch {} finally {
25883
+ clearGitReadMemo("git fetch");
25884
+ }
25781
25885
  }
25782
25886
  function defaultGitDiffShortstat(base, head) {
25783
25887
  try {
@@ -25855,6 +25959,7 @@ function defaultRunSecurityScanSubprocess(command, scanTargetDir) {
25855
25959
  return { ok: true, output: combined };
25856
25960
  return { ok: false, reason: e.message };
25857
25961
  } finally {
25962
+ clearGitReadMemo("security scan");
25858
25963
  try {
25859
25964
  rmSync11(sandbox, { recursive: true, force: true });
25860
25965
  } catch {}
@@ -25871,7 +25976,11 @@ function defaultResolveTaskSurface(task) {
25871
25976
  }
25872
25977
  }
25873
25978
  function defaultPatchIdOf(sha) {
25874
- return patchIdAt("main", sha);
25979
+ try {
25980
+ return patchIdAt("main", sha);
25981
+ } finally {
25982
+ clearGitReadMemo("patch-id fetch");
25983
+ }
25875
25984
  }
25876
25985
  var DevReviewLoopEventInputSchema = z11.discriminatedUnion("event", DevReviewLoopEventSchema.options.map((option) => option.omit({ meta: true, subject: true })));
25877
25986
  function assertValidLoopEvent(e) {
@@ -25915,11 +26024,12 @@ function defaultGitWorktreeUntrackedPaths(worktreePath) {
25915
26024
  }
25916
26025
  }
25917
26026
  function gitOk(worktreePath, args) {
26027
+ const full = ["-C", worktreePath, ...args];
25918
26028
  try {
25919
- return execFileSync22("git", ["-C", worktreePath, ...args], {
26029
+ return runGit(undefined, full, () => execFileSync22("git", full, {
25920
26030
  encoding: "utf8",
25921
26031
  stdio: ["ignore", "pipe", "pipe"]
25922
- }).trim();
26032
+ }).trim());
25923
26033
  } catch {
25924
26034
  return null;
25925
26035
  }
@@ -26024,12 +26134,12 @@ function defaultClassifyAgainstDefaultTip(worktreePath, head, tip, paths, remote
26024
26134
  function rebaseInProgress(worktreePath) {
26025
26135
  return ["rebase-merge", "rebase-apply"].some((name) => {
26026
26136
  const path = gitOk(worktreePath, ["rev-parse", "--git-path", name]);
26027
- return path !== null && existsSync31(resolve7(worktreePath, path));
26137
+ return path !== null && existsSync31(resolve8(worktreePath, path));
26028
26138
  });
26029
26139
  }
26030
26140
  function mergeInProgress2(worktreePath) {
26031
26141
  const path = gitOk(worktreePath, ["rev-parse", "--git-path", "MERGE_HEAD"]);
26032
- return path !== null && existsSync31(resolve7(worktreePath, path));
26142
+ return path !== null && existsSync31(resolve8(worktreePath, path));
26033
26143
  }
26034
26144
  function defaultMergeDefaultTip(worktreePath, tip, remoteUrl) {
26035
26145
  const refuse = (reason, conflictFiles = []) => ({
@@ -26054,6 +26164,7 @@ function defaultMergeDefaultTip(worktreePath, tip, remoteUrl) {
26054
26164
  env: { ...process.env, GIT_EDITOR: "true" },
26055
26165
  stdio: ["ignore", "pipe", "pipe"]
26056
26166
  });
26167
+ clearGitReadMemo("git merge");
26057
26168
  if (!merged.error && merged.status === 0 && !mergeInProgress2(worktreePath)) {
26058
26169
  const head = gitOk(worktreePath, ["rev-parse", "HEAD"]);
26059
26170
  if (head)
@@ -26101,6 +26212,7 @@ function defaultRebaseOntoDefaultTip(worktreePath, tip, remoteUrl) {
26101
26212
  env: { ...process.env, GIT_EDITOR: "true" },
26102
26213
  stdio: ["ignore", "pipe", "pipe"]
26103
26214
  });
26215
+ clearGitReadMemo("git rebase");
26104
26216
  if (!rebased.error && rebased.status === 0 && !rebaseInProgress(worktreePath)) {
26105
26217
  const head = gitOk(worktreePath, ["rev-parse", "HEAD"]);
26106
26218
  if (head)
@@ -26126,7 +26238,11 @@ function ownChangesRangeBase(worktreePath, pushedBase) {
26126
26238
  if (pushedBase === null)
26127
26239
  return null;
26128
26240
  try {
26129
- execFileSync22("git", ["-C", worktreePath, "merge-base", "--is-ancestor", pushedBase, "HEAD"], { stdio: "ignore" });
26241
+ const args = ["-C", worktreePath, "merge-base", "--is-ancestor", pushedBase, "HEAD"];
26242
+ runGit(undefined, args, () => {
26243
+ execFileSync22("git", args, { stdio: "ignore" });
26244
+ return "";
26245
+ });
26130
26246
  return pushedBase;
26131
26247
  } catch (err) {
26132
26248
  if (err.status !== 1)
@@ -26665,6 +26781,7 @@ function defaultBuildVendoredCliIfMissing(worktreePath) {
26665
26781
  encoding: "utf8",
26666
26782
  stdio: ["ignore", "pipe", "pipe"]
26667
26783
  });
26784
+ clearGitReadMemo("vendored CLI build");
26668
26785
  if (result.error || result.status !== 0) {
26669
26786
  const output = `${result.stdout ?? ""}
26670
26787
  ${result.stderr ?? ""}`.trim();
@@ -26690,6 +26807,7 @@ function defaultInstallWorktreeDependencies(worktreePath) {
26690
26807
  stdio: ["ignore", "pipe", "pipe"],
26691
26808
  timeout: 10 * 60 * 1000
26692
26809
  });
26810
+ clearGitReadMemo("dependency install");
26693
26811
  if (result.error || result.status !== 0) {
26694
26812
  const output = `${result.stdout ?? ""}
26695
26813
  ${result.stderr ?? ""}`.trim().split(`
@@ -26724,6 +26842,7 @@ ${"stderr" in err ? String(err.stderr ?? "") : ""}`.trim() : String(err);
26724
26842
  }
26725
26843
  throw err;
26726
26844
  } finally {
26845
+ clearGitReadMemo("git commit");
26727
26846
  rmSync13(traceDir, { recursive: true, force: true });
26728
26847
  }
26729
26848
  return { ok: true, sha: sh("git", ["-C", worktreePath, "rev-parse", "HEAD"]).trim() };
@@ -26774,6 +26893,7 @@ ${String(raw.stderr ?? "")}`.trim();
26774
26893
  const detail = boundedPushOutput(output || (err instanceof Error ? err.message : String(err)), "tail");
26775
26894
  throw new Error(`${exit}: ${detail || "no captured output"}`);
26776
26895
  } finally {
26896
+ clearGitReadMemo("git push");
26777
26897
  rmSync13(traceDir, { recursive: true, force: true });
26778
26898
  }
26779
26899
  }
@@ -27608,6 +27728,7 @@ var runRealLiveCommand = (command, cwd, timeoutMs) => new Promise((resolve) => {
27608
27728
  if (settled)
27609
27729
  return;
27610
27730
  settled = true;
27731
+ clearGitReadMemo("live command");
27611
27732
  clearTimeout(timer);
27612
27733
  if (grace !== undefined)
27613
27734
  clearTimeout(grace);
@@ -27649,6 +27770,7 @@ var LIVE_CHECKOUT_TIMEOUT_MS = 15 * 60000;
27649
27770
  function runFile(file, args, opts) {
27650
27771
  return new Promise((resolve, reject) => {
27651
27772
  execFile11(file, [...args], { cwd: opts.cwd, env: opts.env, timeout: opts.timeoutMs, maxBuffer: 16 * 1024 * 1024 }, (err, _stdout, stderr) => {
27773
+ clearGitReadMemo(`${file} ${args[0] ?? ""}`);
27652
27774
  if (err === null)
27653
27775
  resolve();
27654
27776
  else
@@ -27669,6 +27791,7 @@ async function prepareRealLiveCheckout(repoRoot, head, opts = {}) {
27669
27791
  try {
27670
27792
  execFileSync26("git", ["-C", repoRoot, "worktree", "prune"], { stdio: "ignore" });
27671
27793
  } catch {}
27794
+ clearGitReadMemo("live checkout removed");
27672
27795
  };
27673
27796
  try {
27674
27797
  await runFile("git", ["-C", repoRoot, "-c", "core.hooksPath=/dev/null", "worktree", "add", "--detach", tree, head], {
@@ -28343,13 +28466,13 @@ init_loop_log();
28343
28466
  init_worker_boundary();
28344
28467
  init_issue_validation();
28345
28468
  init_package_root();
28346
- import { resolve as resolve8 } from "node:path";
28469
+ import { resolve as resolve9 } from "node:path";
28347
28470
  import { join as join40 } from "node:path";
28348
28471
  import { readFileSync as readFileSync37 } from "node:fs";
28349
28472
 
28350
28473
  // ../../harness/processes/vinaya-strict/loops/dev-review/run-control/task-run-engine.ts
28351
28474
  import { existsSync as existsSync34, readFileSync as readFileSync36, renameSync as renameSync9, writeFileSync as writeFileSync19 } from "node:fs";
28352
- init_package_root();
28475
+ init_programs();
28353
28476
  init_run_paths();
28354
28477
  function taskRunnerRecordPath(task, root = runtimeDirForThisRepo()) {
28355
28478
  return runPath(root, task, { area: "task", file: "runner.json" });
@@ -28459,7 +28582,7 @@ async function setStandaloneLogIdentity(env = process.env, cliRoot = packageRoot
28459
28582
  }
28460
28583
  env.VINAYA_RUNNER_ID = "standalone";
28461
28584
  env.VINAYA_RUNNER_VERSION = pkg.version;
28462
- const checkout = resolve8(cliRoot, "../..");
28585
+ const checkout = resolve9(cliRoot, "../..");
28463
28586
  const loaderPath = join40(checkout, "harness", "kernel", "dev-process-socket", "loader", "load-process.ts");
28464
28587
  const processFolder = join40(checkout, PROCESS_FOLDER_IN_CHECKOUT);
28465
28588
  if (!existsSync35(join40(checkout, ".git")) || !existsSync35(loaderPath) || !existsSync35(processFolder))
@@ -30182,6 +30305,7 @@ init_round_assess();
30182
30305
 
30183
30306
  // ../../harness/processes/vinaya-strict/tools/dev-review-policy/assess-round.ts
30184
30307
  init_schema();
30308
+ init_log_roles();
30185
30309
  function loopEventEnvelope(state) {
30186
30310
  return { kind: "dev_review_loop", payload: {}, loop_id: state.config.loopId };
30187
30311
  }
@@ -30229,7 +30353,7 @@ function verdictLogRole(role) {
30229
30353
  }
30230
30354
  function reviewerEntries(state, verdicts) {
30231
30355
  const held = new Map(verdicts.map((v) => [verdictLogRole(v.role), v]));
30232
- const isRole = (value) => ROLE_VALUES.includes(value);
30356
+ const isRole = (value) => VINAYA_LOG_ROLE_NAMES.includes(value);
30233
30357
  const roles = [...new Set([...state.config.reviewers.filter(isRole), ...held.keys()])];
30234
30358
  return roles.map((role) => {
30235
30359
  const v = held.get(role);