@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
@@ -1383,6 +1383,138 @@ var init_resolve_repo = __esm(() => {
1383
1383
  };
1384
1384
  });
1385
1385
 
1386
+ // ../../harness/kernel/log/roles.ts
1387
+ function registerRole(name, role) {
1388
+ roles.set(name, role);
1389
+ }
1390
+ function registerTitle(name, title) {
1391
+ titles.set(name, title);
1392
+ }
1393
+ function isRole(value) {
1394
+ return value !== undefined && roles.has(value);
1395
+ }
1396
+ function lookupRole(name) {
1397
+ return roles.get(name);
1398
+ }
1399
+ function lookupTitle(name) {
1400
+ return roles.get(name)?.title ?? titles.get(name);
1401
+ }
1402
+ var roles, titles;
1403
+ var init_roles = __esm(() => {
1404
+ roles = new Map;
1405
+ titles = new Map;
1406
+ });
1407
+
1408
+ // ../../harness/kernel/log/envelope.ts
1409
+ import { createHash } from "node:crypto";
1410
+ function actorIdFromEnv(role) {
1411
+ return role === undefined || role === "" ? null : role;
1412
+ }
1413
+ function lineageFieldFromEnv(value) {
1414
+ return value === undefined || value === "" ? null : value;
1415
+ }
1416
+ function attemptFromEnv(value) {
1417
+ if (value === undefined || value === "")
1418
+ return null;
1419
+ const n = Number(value);
1420
+ return Number.isInteger(n) ? n : null;
1421
+ }
1422
+ function provenanceFor(input) {
1423
+ if (input.provenance)
1424
+ return input.provenance;
1425
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
1426
+ return "unavailable";
1427
+ if (input.env.role || input.env.task)
1428
+ return "env_correlated";
1429
+ return "unavailable";
1430
+ }
1431
+ function issueFromTask(task) {
1432
+ if (task === undefined || task === "")
1433
+ return null;
1434
+ const n = Number(task);
1435
+ return Number.isInteger(n) ? n : null;
1436
+ }
1437
+ function roundFromEnv(round) {
1438
+ if (round === undefined || round === "")
1439
+ return;
1440
+ const n = Number(round);
1441
+ return Number.isInteger(n) ? n : undefined;
1442
+ }
1443
+ function prFromEnv(pr) {
1444
+ if (pr === undefined || pr === "")
1445
+ return;
1446
+ const n = Number(pr);
1447
+ return Number.isInteger(n) && n > 0 ? n : undefined;
1448
+ }
1449
+ function buildHeader(input) {
1450
+ const role = isRole(input.env.role) ? input.env.role : "unattributed";
1451
+ const round = roundFromEnv(input.env.round);
1452
+ const pr = prFromEnv(input.env.pr);
1453
+ const subject = {
1454
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
1455
+ role,
1456
+ ...round !== undefined ? { round } : {},
1457
+ ...pr !== undefined ? { pr } : {},
1458
+ ...input.subject ?? {}
1459
+ };
1460
+ const issue = subject.issue;
1461
+ return {
1462
+ meta: {
1463
+ schema: 4,
1464
+ ts: input.now.toISOString(),
1465
+ run_id: input.runId,
1466
+ seq: input.seq,
1467
+ repo: input.repo,
1468
+ vinaya: input.vinaya,
1469
+ doctrine: input.doctrine,
1470
+ host: input.host,
1471
+ machine: createHash("sha256").update(input.hostname).digest("hex"),
1472
+ event_id: input.eventId,
1473
+ process_id: input.processId,
1474
+ actor_id: actorIdFromEnv(input.env.role),
1475
+ lineage: {
1476
+ run: lineageFieldFromEnv(input.env.run),
1477
+ attempt: attemptFromEnv(input.env.attempt),
1478
+ parent: lineageFieldFromEnv(input.env.parent)
1479
+ },
1480
+ input_versions: {
1481
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
1482
+ objectives_version: input.inputVersions?.objectivesVersion ?? null,
1483
+ brief_hash: input.inputVersions?.briefHash ?? null,
1484
+ ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
1485
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
1486
+ policy_digest: input.inputVersions?.policyDigest ?? null
1487
+ },
1488
+ provenance: provenanceFor(input),
1489
+ work: {
1490
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
1491
+ repo: input.repo,
1492
+ change: pr === undefined ? null : String(pr),
1493
+ revision: input.revision ?? null
1494
+ },
1495
+ flow: {
1496
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
1497
+ version: lineageFieldFromEnv(input.env.flowVersion)
1498
+ },
1499
+ runtime: lineageFieldFromEnv(input.env.runtime),
1500
+ process: {
1501
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
1502
+ version: lineageFieldFromEnv(input.env.processVersion),
1503
+ digest: lineageFieldFromEnv(input.env.processDigest)
1504
+ },
1505
+ runner: {
1506
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
1507
+ version: lineageFieldFromEnv(input.env.runnerVersion)
1508
+ },
1509
+ source: lineageFieldFromEnv(input.env.source)
1510
+ },
1511
+ subject
1512
+ };
1513
+ }
1514
+ var init_envelope = __esm(() => {
1515
+ init_roles();
1516
+ });
1517
+
1386
1518
  // ../../harness/kernel/log/custom.ts
1387
1519
  import { z } from "zod";
1388
1520
  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;
@@ -1440,19 +1572,11 @@ var init_custom = __esm(() => {
1440
1572
 
1441
1573
  // ../../harness/kernel/log/schema.ts
1442
1574
  import { z as z2 } from "zod";
1443
- 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;
1575
+ 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;
1444
1576
  var init_schema = __esm(() => {
1445
1577
  init_custom();
1446
- ROLE_VALUES = [
1447
- "planner",
1448
- "developer",
1449
- "code-reviewer",
1450
- "security",
1451
- "principal",
1452
- "archivist",
1453
- "architect"
1454
- ];
1455
- RoleSchema = z2.enum(ROLE_VALUES);
1578
+ ROLE_NAME_PATTERN = /^[a-z0-9-]+$/;
1579
+ RoleSchema = z2.string().regex(ROLE_NAME_PATTERN);
1456
1580
  HOST_VALUES = ["hook", "ci", "cli", "loop"];
1457
1581
  HostSchema = z2.enum(HOST_VALUES);
1458
1582
  RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
@@ -2034,119 +2158,6 @@ var init_schema = __esm(() => {
2034
2158
  ]);
2035
2159
  });
2036
2160
 
2037
- // ../../harness/kernel/log/envelope.ts
2038
- import { createHash } from "node:crypto";
2039
- function isRole(value) {
2040
- return value !== undefined && ROLE_VALUES.includes(value);
2041
- }
2042
- function actorIdFromEnv(role) {
2043
- return role === undefined || role === "" ? null : role;
2044
- }
2045
- function lineageFieldFromEnv(value) {
2046
- return value === undefined || value === "" ? null : value;
2047
- }
2048
- function attemptFromEnv(value) {
2049
- if (value === undefined || value === "")
2050
- return null;
2051
- const n = Number(value);
2052
- return Number.isInteger(n) ? n : null;
2053
- }
2054
- function provenanceFor(input) {
2055
- if (input.provenance)
2056
- return input.provenance;
2057
- if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
2058
- return "unavailable";
2059
- if (input.env.role || input.env.task)
2060
- return "env_correlated";
2061
- return "unavailable";
2062
- }
2063
- function issueFromTask(task) {
2064
- if (task === undefined || task === "")
2065
- return null;
2066
- const n = Number(task);
2067
- return Number.isInteger(n) ? n : null;
2068
- }
2069
- function roundFromEnv(round) {
2070
- if (round === undefined || round === "")
2071
- return;
2072
- const n = Number(round);
2073
- return Number.isInteger(n) ? n : undefined;
2074
- }
2075
- function prFromEnv(pr) {
2076
- if (pr === undefined || pr === "")
2077
- return;
2078
- const n = Number(pr);
2079
- return Number.isInteger(n) && n > 0 ? n : undefined;
2080
- }
2081
- function buildHeader(input) {
2082
- const role = isRole(input.env.role) ? input.env.role : "unattributed";
2083
- const round = roundFromEnv(input.env.round);
2084
- const pr = prFromEnv(input.env.pr);
2085
- const subject = {
2086
- issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
2087
- role,
2088
- ...round !== undefined ? { round } : {},
2089
- ...pr !== undefined ? { pr } : {},
2090
- ...input.subject ?? {}
2091
- };
2092
- const issue = subject.issue;
2093
- return {
2094
- meta: {
2095
- schema: 4,
2096
- ts: input.now.toISOString(),
2097
- run_id: input.runId,
2098
- seq: input.seq,
2099
- repo: input.repo,
2100
- vinaya: input.vinaya,
2101
- doctrine: input.doctrine,
2102
- host: input.host,
2103
- machine: createHash("sha256").update(input.hostname).digest("hex"),
2104
- event_id: input.eventId,
2105
- process_id: input.processId,
2106
- actor_id: actorIdFromEnv(input.env.role),
2107
- lineage: {
2108
- run: lineageFieldFromEnv(input.env.run),
2109
- attempt: attemptFromEnv(input.env.attempt),
2110
- parent: lineageFieldFromEnv(input.env.parent)
2111
- },
2112
- input_versions: {
2113
- manifest_version: input.inputVersions?.manifestVersion ?? null,
2114
- objectives_version: input.inputVersions?.objectivesVersion ?? null,
2115
- brief_hash: input.inputVersions?.briefHash ?? null,
2116
- ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
2117
- pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
2118
- policy_digest: input.inputVersions?.policyDigest ?? null
2119
- },
2120
- provenance: provenanceFor(input),
2121
- work: {
2122
- ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
2123
- repo: input.repo,
2124
- change: pr === undefined ? null : String(pr),
2125
- revision: input.revision ?? null
2126
- },
2127
- flow: {
2128
- id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
2129
- version: lineageFieldFromEnv(input.env.flowVersion)
2130
- },
2131
- runtime: lineageFieldFromEnv(input.env.runtime),
2132
- process: {
2133
- id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
2134
- version: lineageFieldFromEnv(input.env.processVersion),
2135
- digest: lineageFieldFromEnv(input.env.processDigest)
2136
- },
2137
- runner: {
2138
- id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
2139
- version: lineageFieldFromEnv(input.env.runnerVersion)
2140
- },
2141
- source: lineageFieldFromEnv(input.env.source)
2142
- },
2143
- subject
2144
- };
2145
- }
2146
- var init_envelope = __esm(() => {
2147
- init_schema();
2148
- });
2149
-
2150
2161
  // ../../harness/kernel/log/redact.ts
2151
2162
  function redactString(value, home) {
2152
2163
  let out = value.replace(GITHUB_TOKEN_PATTERN, "<redacted>").replace(CLASSIC_GITHUB_PAT_PATTERN, "$1<redacted>").replace(BEARER_TOKEN_PATTERN, "<redacted>").replace(AWS_ACCESS_KEY_PATTERN, "<redacted>").replace(SLACK_TOKEN_PATTERN, "<redacted>").replace(STRIPE_KEY_PATTERN, "<redacted>").replace(ANTHROPIC_KEY_PATTERN, "<redacted>").replace(OPENAI_KEY_PATTERN, "<redacted>").replace(NPM_TOKEN_PATTERN, "<redacted>").replace(JWT_PATTERN, "<redacted>").replace(PEM_BLOCK_PATTERN, "<redacted>").replace(BASIC_AUTH_URL_PATTERN, "$1<redacted>@").replace(GENERIC_SECRET_ASSIGNMENT_PATTERN, "$1<redacted>");
@@ -2930,7 +2941,8 @@ function code(value) {
2930
2941
  return typeof value === "string" && CODE_TOKEN_PATTERN.test(value) ? value : null;
2931
2942
  }
2932
2943
  function roleSubject(value, sentenceStart = true) {
2933
- const name = typeof value === "string" && ROLE_VALUES.includes(value) ? `the ${value === "security" ? "security reviewer" : value.replace(/-/g, " ")}` : "a role";
2944
+ const known = typeof value === "string" ? lookupRole(value) : undefined;
2945
+ const name = known ? `the ${known.reading}` : "a role";
2934
2946
  return sentenceStart ? `${name[0]?.toUpperCase()}${name.slice(1)}` : name;
2935
2947
  }
2936
2948
  function roundLabel(record) {
@@ -3049,7 +3061,7 @@ function conflictReentry(record) {
3049
3061
  function dispatched(record) {
3050
3062
  const role = text(record.target_role);
3051
3063
  const who = roleSubject(role);
3052
- const reviewing = role === "code-reviewer" || role === "security";
3064
+ const reviewing = role !== null && (lookupRole(role)?.reviews ?? false);
3053
3065
  const round = whole(record.round);
3054
3066
  return {
3055
3067
  kind: "working",
@@ -3108,6 +3120,7 @@ function narrate(record, earlier = []) {
3108
3120
  }
3109
3121
  var REASONS, PAUSE_WITHOUT_CODE;
3110
3122
  var init_narration = __esm(() => {
3123
+ init_roles();
3111
3124
  init_schema();
3112
3125
  REASONS = {
3113
3126
  escalation: { words: "a role escalated a question", person: true },
@@ -3140,13 +3153,7 @@ var init_narration = __esm(() => {
3140
3153
 
3141
3154
  // ../../harness/kernel/adapters/agents/agent-line.ts
3142
3155
  function roleLabel(role) {
3143
- if (role in roleLabels)
3144
- return roleLabels[role];
3145
- if (role === "dev-review-loop")
3146
- return "Loop";
3147
- if (role === "operator")
3148
- return "Operator";
3149
- return role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
3156
+ return lookupTitle(role) ?? role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
3150
3157
  }
3151
3158
  function formatLineMeta(meta) {
3152
3159
  if (meta === undefined)
@@ -3160,17 +3167,9 @@ function formatAgentLine(role, words, options = {}) {
3160
3167
  const mark = options.unicode ?? true ? unicodeMarks[options.mark ?? "working"] : asciiMarks[options.mark ?? "working"];
3161
3168
  return `${time} ${mark} ${roleLabel(role)} ${words}`;
3162
3169
  }
3163
- var roleLabels, unicodeMarks, asciiMarks, META_KEY, META_VALUE;
3170
+ var unicodeMarks, asciiMarks, META_KEY, META_VALUE;
3164
3171
  var init_agent_line = __esm(() => {
3165
- roleLabels = {
3166
- planner: "Planner",
3167
- developer: "Developer",
3168
- "code-reviewer": "Code review",
3169
- security: "Security",
3170
- principal: "Principal",
3171
- archivist: "Archivist",
3172
- architect: "Architect"
3173
- };
3172
+ init_roles();
3174
3173
  unicodeMarks = { working: "▸", done: "✓", failed: "✕", waiting: "◌", round: "◆" };
3175
3174
  asciiMarks = { working: ">", done: "+", failed: "x", waiting: "~", round: "#" };
3176
3175
  META_KEY = /^[a-z]+$/;
@@ -6380,11 +6379,12 @@ function lookup(name) {
6380
6379
  throw new Error(`no program named '${name}' — the program table names: ${[...PROGRAMS.keys()].join(", ")}`);
6381
6380
  return found;
6382
6381
  }
6383
- function programFile(name) {
6382
+ function programFile(name, packageRoot = cliPackageRoot(), fromSource = FROM_SOURCE) {
6384
6383
  const entry = lookup(name);
6385
- const built = join12(cliPackageRoot(), entry.built);
6386
- const source = join12(SOURCE_ROOT, entry.source);
6387
- if (FROM_SOURCE && existsSync10(source))
6384
+ return pickFile(join12(packageRoot, entry.built), join12(SOURCE_ROOT, entry.source), fromSource);
6385
+ }
6386
+ function pickFile(built, source, fromSource) {
6387
+ if (fromSource && existsSync10(source))
6388
6388
  return source;
6389
6389
  return existsSync10(built) ? built : source;
6390
6390
  }
@@ -6445,7 +6445,9 @@ var init_programs = __esm(() => {
6445
6445
  program("log-selftest", `${P}/integration/bin/log-selftest.ts`, "dist/programs/log-selftest.js", [
6446
6446
  words("log", "selftest")
6447
6447
  ]),
6448
- program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")])
6448
+ program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")]),
6449
+ program("run-engine", `${P}/bin/run-engine.ts`, "dist/programs/run-engine.js"),
6450
+ program("supervised-command", `${P}/loops/dev-review/v2/supervised-command.ts`, "dist/programs/supervised-command.js")
6449
6451
  ]);
6450
6452
  SOURCE_ROOT = join12(dirname10(fileURLToPath4(import.meta.url)), "..", "..", "..", "..");
6451
6453
  FROM_SOURCE = fileURLToPath4(import.meta.url).endsWith(".ts");
@@ -6537,6 +6539,28 @@ var init_install_process = __esm(() => {
6537
6539
  SLOT_ORDER = ["log", "config", "checks"];
6538
6540
  });
6539
6541
 
6542
+ // ../../harness/processes/vinaya-strict/integration/log/log-roles.ts
6543
+ function registerVinayaLogRoles() {
6544
+ for (const { name, reading, title, reviews } of VINAYA_LOG_ROLES)
6545
+ registerRole(name, { reading, title, reviews });
6546
+ registerTitle("dev-review-loop", "Loop");
6547
+ }
6548
+ var VINAYA_LOG_ROLES, VINAYA_LOG_ROLE_NAMES;
6549
+ var init_log_roles = __esm(() => {
6550
+ init_roles();
6551
+ VINAYA_LOG_ROLES = [
6552
+ { name: "planner", reading: "planner", title: "Planner", reviews: false },
6553
+ { name: "developer", reading: "developer", title: "Developer", reviews: false },
6554
+ { name: "code-reviewer", reading: "code reviewer", title: "Code review", reviews: true },
6555
+ { name: "security", reading: "security reviewer", title: "Security", reviews: true },
6556
+ { name: "principal", reading: "principal", title: "Principal", reviews: false },
6557
+ { name: "archivist", reading: "archivist", title: "Archivist", reviews: false },
6558
+ { name: "architect", reading: "architect", title: "Architect", reviews: false }
6559
+ ];
6560
+ VINAYA_LOG_ROLE_NAMES = VINAYA_LOG_ROLES.map((role) => role.name);
6561
+ registerVinayaLogRoles();
6562
+ });
6563
+
6540
6564
  // ../../harness/processes/vinaya-strict/integration/log/branch-issue.ts
6541
6565
  import { execFile as execFile8 } from "node:child_process";
6542
6566
  import { promisify as promisify8 } from "node:util";
@@ -6739,6 +6763,7 @@ function installVinayaLogSinkFactory() {
6739
6763
  var init_log_sink_factory = __esm(() => {
6740
6764
  init_log_sink();
6741
6765
  init_package_root();
6766
+ init_log_roles();
6742
6767
  init_branch_issue();
6743
6768
  init_doctrine_version();
6744
6769
  });
@@ -7134,8 +7159,8 @@ var init_protected_paths2 = __esm(() => {
7134
7159
 
7135
7160
  // ../../harness/processes/vinaya-strict/integration/policies/roles.ts
7136
7161
  var GRANTED_ROLES, ROLE_TOOL_GRANTS, VINAYA_TOOL_GRANTS, VINAYA_BROKER_ROLES, VINAYA_BOUNDARY_ROLES, OPERATOR_TOOL_GRANT, VINAYA_ROUTER_ROLES;
7137
- var init_roles = __esm(() => {
7138
- init_schema();
7162
+ var init_roles2 = __esm(() => {
7163
+ init_log_roles();
7139
7164
  GRANTED_ROLES = ["developer", "code-reviewer", "security", "controller"];
7140
7165
  ROLE_TOOL_GRANTS = {
7141
7166
  developer: [
@@ -7154,7 +7179,7 @@ var init_roles = __esm(() => {
7154
7179
  };
7155
7180
  VINAYA_TOOL_GRANTS = { roles: GRANTED_ROLES, grants: ROLE_TOOL_GRANTS };
7156
7181
  VINAYA_BROKER_ROLES = {
7157
- recognizedRoles: ROLE_VALUES,
7182
+ recognizedRoles: VINAYA_LOG_ROLE_NAMES,
7158
7183
  workerRoles: ["developer"],
7159
7184
  surfaceOwner: "the Planner"
7160
7185
  };
@@ -7238,7 +7263,7 @@ function vinayaRouterPolicies() {
7238
7263
  var init_vinaya_policies = __esm(() => {
7239
7264
  init_launch_records();
7240
7265
  init_protected_paths2();
7241
- init_roles();
7266
+ init_roles2();
7242
7267
  init_scratch_names();
7243
7268
  });
7244
7269