@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
@@ -3368,21 +3368,145 @@ var init_resolve_repo = __esm(() => {
3368
3368
  };
3369
3369
  });
3370
3370
 
3371
+ // ../../harness/kernel/log/roles.ts
3372
+ function registerRole(name, role) {
3373
+ roles.set(name, role);
3374
+ }
3375
+ function registerTitle(name, title) {
3376
+ titles.set(name, title);
3377
+ }
3378
+ function isRole(value) {
3379
+ return value !== undefined && roles.has(value);
3380
+ }
3381
+ function lookupRole(name) {
3382
+ return roles.get(name);
3383
+ }
3384
+ function lookupTitle(name) {
3385
+ return roles.get(name)?.title ?? titles.get(name);
3386
+ }
3387
+ var roles, titles;
3388
+ var init_roles = __esm(() => {
3389
+ roles = new Map;
3390
+ titles = new Map;
3391
+ });
3392
+
3393
+ // ../../harness/kernel/log/envelope.ts
3394
+ import { createHash as createHash2 } from "node:crypto";
3395
+ function actorIdFromEnv(role) {
3396
+ return role === undefined || role === "" ? null : role;
3397
+ }
3398
+ function lineageFieldFromEnv(value) {
3399
+ return value === undefined || value === "" ? null : value;
3400
+ }
3401
+ function attemptFromEnv(value) {
3402
+ if (value === undefined || value === "")
3403
+ return null;
3404
+ const n = Number(value);
3405
+ return Number.isInteger(n) ? n : null;
3406
+ }
3407
+ function provenanceFor(input) {
3408
+ if (input.provenance)
3409
+ return input.provenance;
3410
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
3411
+ return "unavailable";
3412
+ if (input.env.role || input.env.task)
3413
+ return "env_correlated";
3414
+ return "unavailable";
3415
+ }
3416
+ function issueFromTask(task) {
3417
+ if (task === undefined || task === "")
3418
+ return null;
3419
+ const n = Number(task);
3420
+ return Number.isInteger(n) ? n : null;
3421
+ }
3422
+ function roundFromEnv(round) {
3423
+ if (round === undefined || round === "")
3424
+ return;
3425
+ const n = Number(round);
3426
+ return Number.isInteger(n) ? n : undefined;
3427
+ }
3428
+ function prFromEnv(pr) {
3429
+ if (pr === undefined || pr === "")
3430
+ return;
3431
+ const n = Number(pr);
3432
+ return Number.isInteger(n) && n > 0 ? n : undefined;
3433
+ }
3434
+ function buildHeader(input) {
3435
+ const role = isRole(input.env.role) ? input.env.role : "unattributed";
3436
+ const round = roundFromEnv(input.env.round);
3437
+ const pr = prFromEnv(input.env.pr);
3438
+ const subject = {
3439
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
3440
+ role,
3441
+ ...round !== undefined ? { round } : {},
3442
+ ...pr !== undefined ? { pr } : {},
3443
+ ...input.subject ?? {}
3444
+ };
3445
+ const issue = subject.issue;
3446
+ return {
3447
+ meta: {
3448
+ schema: 4,
3449
+ ts: input.now.toISOString(),
3450
+ run_id: input.runId,
3451
+ seq: input.seq,
3452
+ repo: input.repo,
3453
+ vinaya: input.vinaya,
3454
+ doctrine: input.doctrine,
3455
+ host: input.host,
3456
+ machine: createHash2("sha256").update(input.hostname).digest("hex"),
3457
+ event_id: input.eventId,
3458
+ process_id: input.processId,
3459
+ actor_id: actorIdFromEnv(input.env.role),
3460
+ lineage: {
3461
+ run: lineageFieldFromEnv(input.env.run),
3462
+ attempt: attemptFromEnv(input.env.attempt),
3463
+ parent: lineageFieldFromEnv(input.env.parent)
3464
+ },
3465
+ input_versions: {
3466
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
3467
+ objectives_version: input.inputVersions?.objectivesVersion ?? null,
3468
+ brief_hash: input.inputVersions?.briefHash ?? null,
3469
+ ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
3470
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
3471
+ policy_digest: input.inputVersions?.policyDigest ?? null
3472
+ },
3473
+ provenance: provenanceFor(input),
3474
+ work: {
3475
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
3476
+ repo: input.repo,
3477
+ change: pr === undefined ? null : String(pr),
3478
+ revision: input.revision ?? null
3479
+ },
3480
+ flow: {
3481
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
3482
+ version: lineageFieldFromEnv(input.env.flowVersion)
3483
+ },
3484
+ runtime: lineageFieldFromEnv(input.env.runtime),
3485
+ process: {
3486
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
3487
+ version: lineageFieldFromEnv(input.env.processVersion),
3488
+ digest: lineageFieldFromEnv(input.env.processDigest)
3489
+ },
3490
+ runner: {
3491
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
3492
+ version: lineageFieldFromEnv(input.env.runnerVersion)
3493
+ },
3494
+ source: lineageFieldFromEnv(input.env.source)
3495
+ },
3496
+ subject
3497
+ };
3498
+ }
3499
+ var init_envelope = __esm(() => {
3500
+ init_roles();
3501
+ });
3502
+
3371
3503
  // ../../harness/kernel/log/schema.ts
3372
3504
  import { z as z6 } from "zod";
3373
- 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;
3505
+ 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;
3374
3506
  var init_schema = __esm(() => {
3375
3507
  init_custom();
3376
- ROLE_VALUES = [
3377
- "planner",
3378
- "developer",
3379
- "code-reviewer",
3380
- "security",
3381
- "principal",
3382
- "archivist",
3383
- "architect"
3384
- ];
3385
- RoleSchema = z6.enum(ROLE_VALUES);
3508
+ ROLE_NAME_PATTERN = /^[a-z0-9-]+$/;
3509
+ RoleSchema = z6.string().regex(ROLE_NAME_PATTERN);
3386
3510
  HOST_VALUES = ["hook", "ci", "cli", "loop"];
3387
3511
  HostSchema = z6.enum(HOST_VALUES);
3388
3512
  RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
@@ -3964,119 +4088,6 @@ var init_schema = __esm(() => {
3964
4088
  ]);
3965
4089
  });
3966
4090
 
3967
- // ../../harness/kernel/log/envelope.ts
3968
- import { createHash as createHash2 } from "node:crypto";
3969
- function isRole(value) {
3970
- return value !== undefined && ROLE_VALUES.includes(value);
3971
- }
3972
- function actorIdFromEnv(role) {
3973
- return role === undefined || role === "" ? null : role;
3974
- }
3975
- function lineageFieldFromEnv(value) {
3976
- return value === undefined || value === "" ? null : value;
3977
- }
3978
- function attemptFromEnv(value) {
3979
- if (value === undefined || value === "")
3980
- return null;
3981
- const n = Number(value);
3982
- return Number.isInteger(n) ? n : null;
3983
- }
3984
- function provenanceFor(input) {
3985
- if (input.provenance)
3986
- return input.provenance;
3987
- if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
3988
- return "unavailable";
3989
- if (input.env.role || input.env.task)
3990
- return "env_correlated";
3991
- return "unavailable";
3992
- }
3993
- function issueFromTask(task) {
3994
- if (task === undefined || task === "")
3995
- return null;
3996
- const n = Number(task);
3997
- return Number.isInteger(n) ? n : null;
3998
- }
3999
- function roundFromEnv(round) {
4000
- if (round === undefined || round === "")
4001
- return;
4002
- const n = Number(round);
4003
- return Number.isInteger(n) ? n : undefined;
4004
- }
4005
- function prFromEnv(pr) {
4006
- if (pr === undefined || pr === "")
4007
- return;
4008
- const n = Number(pr);
4009
- return Number.isInteger(n) && n > 0 ? n : undefined;
4010
- }
4011
- function buildHeader(input) {
4012
- const role = isRole(input.env.role) ? input.env.role : "unattributed";
4013
- const round = roundFromEnv(input.env.round);
4014
- const pr = prFromEnv(input.env.pr);
4015
- const subject = {
4016
- issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
4017
- role,
4018
- ...round !== undefined ? { round } : {},
4019
- ...pr !== undefined ? { pr } : {},
4020
- ...input.subject ?? {}
4021
- };
4022
- const issue = subject.issue;
4023
- return {
4024
- meta: {
4025
- schema: 4,
4026
- ts: input.now.toISOString(),
4027
- run_id: input.runId,
4028
- seq: input.seq,
4029
- repo: input.repo,
4030
- vinaya: input.vinaya,
4031
- doctrine: input.doctrine,
4032
- host: input.host,
4033
- machine: createHash2("sha256").update(input.hostname).digest("hex"),
4034
- event_id: input.eventId,
4035
- process_id: input.processId,
4036
- actor_id: actorIdFromEnv(input.env.role),
4037
- lineage: {
4038
- run: lineageFieldFromEnv(input.env.run),
4039
- attempt: attemptFromEnv(input.env.attempt),
4040
- parent: lineageFieldFromEnv(input.env.parent)
4041
- },
4042
- input_versions: {
4043
- manifest_version: input.inputVersions?.manifestVersion ?? null,
4044
- objectives_version: input.inputVersions?.objectivesVersion ?? null,
4045
- brief_hash: input.inputVersions?.briefHash ?? null,
4046
- ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
4047
- pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
4048
- policy_digest: input.inputVersions?.policyDigest ?? null
4049
- },
4050
- provenance: provenanceFor(input),
4051
- work: {
4052
- ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
4053
- repo: input.repo,
4054
- change: pr === undefined ? null : String(pr),
4055
- revision: input.revision ?? null
4056
- },
4057
- flow: {
4058
- id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
4059
- version: lineageFieldFromEnv(input.env.flowVersion)
4060
- },
4061
- runtime: lineageFieldFromEnv(input.env.runtime),
4062
- process: {
4063
- id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
4064
- version: lineageFieldFromEnv(input.env.processVersion),
4065
- digest: lineageFieldFromEnv(input.env.processDigest)
4066
- },
4067
- runner: {
4068
- id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
4069
- version: lineageFieldFromEnv(input.env.runnerVersion)
4070
- },
4071
- source: lineageFieldFromEnv(input.env.source)
4072
- },
4073
- subject
4074
- };
4075
- }
4076
- var init_envelope = __esm(() => {
4077
- init_schema();
4078
- });
4079
-
4080
4091
  // ../../harness/kernel/log/redact.ts
4081
4092
  function redactString(value, home) {
4082
4093
  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>");
@@ -4574,7 +4585,8 @@ function code(value) {
4574
4585
  return typeof value === "string" && CODE_TOKEN_PATTERN.test(value) ? value : null;
4575
4586
  }
4576
4587
  function roleSubject(value, sentenceStart = true) {
4577
- const name = typeof value === "string" && ROLE_VALUES.includes(value) ? `the ${value === "security" ? "security reviewer" : value.replace(/-/g, " ")}` : "a role";
4588
+ const known = typeof value === "string" ? lookupRole(value) : undefined;
4589
+ const name = known ? `the ${known.reading}` : "a role";
4578
4590
  return sentenceStart ? `${name[0]?.toUpperCase()}${name.slice(1)}` : name;
4579
4591
  }
4580
4592
  function roundLabel(record) {
@@ -4693,7 +4705,7 @@ function conflictReentry(record) {
4693
4705
  function dispatched(record) {
4694
4706
  const role = text(record.target_role);
4695
4707
  const who = roleSubject(role);
4696
- const reviewing = role === "code-reviewer" || role === "security";
4708
+ const reviewing = role !== null && (lookupRole(role)?.reviews ?? false);
4697
4709
  const round = whole(record.round);
4698
4710
  return {
4699
4711
  kind: "working",
@@ -4752,6 +4764,7 @@ function narrate(record, earlier = []) {
4752
4764
  }
4753
4765
  var REASONS, PAUSE_WITHOUT_CODE;
4754
4766
  var init_narration = __esm(() => {
4767
+ init_roles();
4755
4768
  init_schema();
4756
4769
  REASONS = {
4757
4770
  escalation: { words: "a role escalated a question", person: true },
@@ -4784,13 +4797,7 @@ var init_narration = __esm(() => {
4784
4797
 
4785
4798
  // ../../harness/kernel/adapters/agents/agent-line.ts
4786
4799
  function roleLabel(role) {
4787
- if (role in roleLabels)
4788
- return roleLabels[role];
4789
- if (role === "dev-review-loop")
4790
- return "Loop";
4791
- if (role === "operator")
4792
- return "Operator";
4793
- return role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4800
+ return lookupTitle(role) ?? role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4794
4801
  }
4795
4802
  function formatLineMeta(meta) {
4796
4803
  if (meta === undefined)
@@ -4804,17 +4811,9 @@ function formatAgentLine(role, words, options = {}) {
4804
4811
  const mark = options.unicode ?? true ? unicodeMarks[options.mark ?? "working"] : asciiMarks[options.mark ?? "working"];
4805
4812
  return `${time} ${mark} ${roleLabel(role)} ${words}`;
4806
4813
  }
4807
- var roleLabels, unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4814
+ var unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4808
4815
  var init_agent_line = __esm(() => {
4809
- roleLabels = {
4810
- planner: "Planner",
4811
- developer: "Developer",
4812
- "code-reviewer": "Code review",
4813
- security: "Security",
4814
- principal: "Principal",
4815
- archivist: "Archivist",
4816
- architect: "Architect"
4817
- };
4816
+ init_roles();
4818
4817
  unicodeMarks = { working: "▸", done: "✓", failed: "✕", waiting: "◌", round: "◆" };
4819
4818
  asciiMarks = { working: ">", done: "+", failed: "x", waiting: "~", round: "#" };
4820
4819
  META_KEY = /^[a-z]+$/;
@@ -6036,6 +6035,28 @@ var init_log_sink = __esm(() => {
6036
6035
  defaultSinkSlot = createDefaultLogSinkSlot(process.env.VINAYA_RUN_ID || randomUUID2());
6037
6036
  });
6038
6037
 
6038
+ // ../../harness/processes/vinaya-strict/integration/log/log-roles.ts
6039
+ function registerVinayaLogRoles() {
6040
+ for (const { name, reading, title, reviews } of VINAYA_LOG_ROLES)
6041
+ registerRole(name, { reading, title, reviews });
6042
+ registerTitle("dev-review-loop", "Loop");
6043
+ }
6044
+ var VINAYA_LOG_ROLES, VINAYA_LOG_ROLE_NAMES;
6045
+ var init_log_roles = __esm(() => {
6046
+ init_roles();
6047
+ VINAYA_LOG_ROLES = [
6048
+ { name: "planner", reading: "planner", title: "Planner", reviews: false },
6049
+ { name: "developer", reading: "developer", title: "Developer", reviews: false },
6050
+ { name: "code-reviewer", reading: "code reviewer", title: "Code review", reviews: true },
6051
+ { name: "security", reading: "security reviewer", title: "Security", reviews: true },
6052
+ { name: "principal", reading: "principal", title: "Principal", reviews: false },
6053
+ { name: "archivist", reading: "archivist", title: "Archivist", reviews: false },
6054
+ { name: "architect", reading: "architect", title: "Architect", reviews: false }
6055
+ ];
6056
+ VINAYA_LOG_ROLE_NAMES = VINAYA_LOG_ROLES.map((role) => role.name);
6057
+ registerVinayaLogRoles();
6058
+ });
6059
+
6039
6060
  // ../../harness/processes/vinaya-strict/integration/log/branch-issue.ts
6040
6061
  import { execFile as execFile5 } from "node:child_process";
6041
6062
  import { promisify as promisify5 } from "node:util";
@@ -6238,6 +6259,7 @@ function installVinayaLogSinkFactory() {
6238
6259
  var init_log_sink_factory = __esm(() => {
6239
6260
  init_log_sink();
6240
6261
  init_package_root();
6262
+ init_log_roles();
6241
6263
  init_branch_issue();
6242
6264
  init_doctrine_version();
6243
6265
  });
@@ -6643,8 +6665,8 @@ var init_protected_paths2 = __esm(() => {
6643
6665
 
6644
6666
  // ../../harness/processes/vinaya-strict/integration/policies/roles.ts
6645
6667
  var GRANTED_ROLES, ROLE_TOOL_GRANTS, VINAYA_TOOL_GRANTS, VINAYA_BROKER_ROLES, VINAYA_BOUNDARY_ROLES, OPERATOR_TOOL_GRANT, VINAYA_ROUTER_ROLES;
6646
- var init_roles = __esm(() => {
6647
- init_schema();
6668
+ var init_roles2 = __esm(() => {
6669
+ init_log_roles();
6648
6670
  GRANTED_ROLES = ["developer", "code-reviewer", "security", "controller"];
6649
6671
  ROLE_TOOL_GRANTS = {
6650
6672
  developer: [
@@ -6663,7 +6685,7 @@ var init_roles = __esm(() => {
6663
6685
  };
6664
6686
  VINAYA_TOOL_GRANTS = { roles: GRANTED_ROLES, grants: ROLE_TOOL_GRANTS };
6665
6687
  VINAYA_BROKER_ROLES = {
6666
- recognizedRoles: ROLE_VALUES,
6688
+ recognizedRoles: VINAYA_LOG_ROLE_NAMES,
6667
6689
  workerRoles: ["developer"],
6668
6690
  surfaceOwner: "the Planner"
6669
6691
  };
@@ -6747,7 +6769,7 @@ function vinayaRouterPolicies() {
6747
6769
  var init_vinaya_policies = __esm(() => {
6748
6770
  init_launch_records();
6749
6771
  init_protected_paths2();
6750
- init_roles();
6772
+ init_roles2();
6751
6773
  init_scratch_names();
6752
6774
  });
6753
6775
 
@@ -6834,7 +6856,9 @@ var init_programs = __esm(() => {
6834
6856
  program("log-selftest", `${P}/integration/bin/log-selftest.ts`, "dist/programs/log-selftest.js", [
6835
6857
  words("log", "selftest")
6836
6858
  ]),
6837
- program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")])
6859
+ program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")]),
6860
+ program("run-engine", `${P}/bin/run-engine.ts`, "dist/programs/run-engine.js"),
6861
+ program("supervised-command", `${P}/loops/dev-review/v2/supervised-command.ts`, "dist/programs/supervised-command.js")
6838
6862
  ]);
6839
6863
  SOURCE_ROOT = join12(dirname9(fileURLToPath4(import.meta.url)), "..", "..", "..", "..");
6840
6864
  FROM_SOURCE = fileURLToPath4(import.meta.url).endsWith(".ts");