@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
@@ -3526,21 +3526,145 @@ var init_resolve_repo = __esm(() => {
3526
3526
  };
3527
3527
  });
3528
3528
 
3529
+ // ../../harness/kernel/log/roles.ts
3530
+ function registerRole(name, role) {
3531
+ roles.set(name, role);
3532
+ }
3533
+ function registerTitle(name, title) {
3534
+ titles.set(name, title);
3535
+ }
3536
+ function isRole(value) {
3537
+ return value !== undefined && roles.has(value);
3538
+ }
3539
+ function lookupRole(name) {
3540
+ return roles.get(name);
3541
+ }
3542
+ function lookupTitle(name) {
3543
+ return roles.get(name)?.title ?? titles.get(name);
3544
+ }
3545
+ var roles, titles;
3546
+ var init_roles = __esm(() => {
3547
+ roles = new Map;
3548
+ titles = new Map;
3549
+ });
3550
+
3551
+ // ../../harness/kernel/log/envelope.ts
3552
+ import { createHash as createHash2 } from "node:crypto";
3553
+ function actorIdFromEnv(role) {
3554
+ return role === undefined || role === "" ? null : role;
3555
+ }
3556
+ function lineageFieldFromEnv(value) {
3557
+ return value === undefined || value === "" ? null : value;
3558
+ }
3559
+ function attemptFromEnv(value) {
3560
+ if (value === undefined || value === "")
3561
+ return null;
3562
+ const n = Number(value);
3563
+ return Number.isInteger(n) ? n : null;
3564
+ }
3565
+ function provenanceFor(input) {
3566
+ if (input.provenance)
3567
+ return input.provenance;
3568
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
3569
+ return "unavailable";
3570
+ if (input.env.role || input.env.task)
3571
+ return "env_correlated";
3572
+ return "unavailable";
3573
+ }
3574
+ function issueFromTask(task) {
3575
+ if (task === undefined || task === "")
3576
+ return null;
3577
+ const n = Number(task);
3578
+ return Number.isInteger(n) ? n : null;
3579
+ }
3580
+ function roundFromEnv(round) {
3581
+ if (round === undefined || round === "")
3582
+ return;
3583
+ const n = Number(round);
3584
+ return Number.isInteger(n) ? n : undefined;
3585
+ }
3586
+ function prFromEnv(pr) {
3587
+ if (pr === undefined || pr === "")
3588
+ return;
3589
+ const n = Number(pr);
3590
+ return Number.isInteger(n) && n > 0 ? n : undefined;
3591
+ }
3592
+ function buildHeader(input) {
3593
+ const role = isRole(input.env.role) ? input.env.role : "unattributed";
3594
+ const round = roundFromEnv(input.env.round);
3595
+ const pr = prFromEnv(input.env.pr);
3596
+ const subject = {
3597
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
3598
+ role,
3599
+ ...round !== undefined ? { round } : {},
3600
+ ...pr !== undefined ? { pr } : {},
3601
+ ...input.subject ?? {}
3602
+ };
3603
+ const issue = subject.issue;
3604
+ return {
3605
+ meta: {
3606
+ schema: 4,
3607
+ ts: input.now.toISOString(),
3608
+ run_id: input.runId,
3609
+ seq: input.seq,
3610
+ repo: input.repo,
3611
+ vinaya: input.vinaya,
3612
+ doctrine: input.doctrine,
3613
+ host: input.host,
3614
+ machine: createHash2("sha256").update(input.hostname).digest("hex"),
3615
+ event_id: input.eventId,
3616
+ process_id: input.processId,
3617
+ actor_id: actorIdFromEnv(input.env.role),
3618
+ lineage: {
3619
+ run: lineageFieldFromEnv(input.env.run),
3620
+ attempt: attemptFromEnv(input.env.attempt),
3621
+ parent: lineageFieldFromEnv(input.env.parent)
3622
+ },
3623
+ input_versions: {
3624
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
3625
+ objectives_version: input.inputVersions?.objectivesVersion ?? null,
3626
+ brief_hash: input.inputVersions?.briefHash ?? null,
3627
+ ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
3628
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
3629
+ policy_digest: input.inputVersions?.policyDigest ?? null
3630
+ },
3631
+ provenance: provenanceFor(input),
3632
+ work: {
3633
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
3634
+ repo: input.repo,
3635
+ change: pr === undefined ? null : String(pr),
3636
+ revision: input.revision ?? null
3637
+ },
3638
+ flow: {
3639
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
3640
+ version: lineageFieldFromEnv(input.env.flowVersion)
3641
+ },
3642
+ runtime: lineageFieldFromEnv(input.env.runtime),
3643
+ process: {
3644
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
3645
+ version: lineageFieldFromEnv(input.env.processVersion),
3646
+ digest: lineageFieldFromEnv(input.env.processDigest)
3647
+ },
3648
+ runner: {
3649
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
3650
+ version: lineageFieldFromEnv(input.env.runnerVersion)
3651
+ },
3652
+ source: lineageFieldFromEnv(input.env.source)
3653
+ },
3654
+ subject
3655
+ };
3656
+ }
3657
+ var init_envelope = __esm(() => {
3658
+ init_roles();
3659
+ });
3660
+
3529
3661
  // ../../harness/kernel/log/schema.ts
3530
3662
  import { z as z6 } from "zod";
3531
- 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;
3663
+ 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;
3532
3664
  var init_schema = __esm(() => {
3533
3665
  init_custom();
3534
- ROLE_VALUES = [
3535
- "planner",
3536
- "developer",
3537
- "code-reviewer",
3538
- "security",
3539
- "principal",
3540
- "archivist",
3541
- "architect"
3542
- ];
3543
- RoleSchema = z6.enum(ROLE_VALUES);
3666
+ ROLE_NAME_PATTERN = /^[a-z0-9-]+$/;
3667
+ RoleSchema = z6.string().regex(ROLE_NAME_PATTERN);
3544
3668
  HOST_VALUES = ["hook", "ci", "cli", "loop"];
3545
3669
  HostSchema = z6.enum(HOST_VALUES);
3546
3670
  RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
@@ -4122,119 +4246,6 @@ var init_schema = __esm(() => {
4122
4246
  ]);
4123
4247
  });
4124
4248
 
4125
- // ../../harness/kernel/log/envelope.ts
4126
- import { createHash as createHash2 } from "node:crypto";
4127
- function isRole(value) {
4128
- return value !== undefined && ROLE_VALUES.includes(value);
4129
- }
4130
- function actorIdFromEnv(role) {
4131
- return role === undefined || role === "" ? null : role;
4132
- }
4133
- function lineageFieldFromEnv(value) {
4134
- return value === undefined || value === "" ? null : value;
4135
- }
4136
- function attemptFromEnv(value) {
4137
- if (value === undefined || value === "")
4138
- return null;
4139
- const n = Number(value);
4140
- return Number.isInteger(n) ? n : null;
4141
- }
4142
- function provenanceFor(input) {
4143
- if (input.provenance)
4144
- return input.provenance;
4145
- if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
4146
- return "unavailable";
4147
- if (input.env.role || input.env.task)
4148
- return "env_correlated";
4149
- return "unavailable";
4150
- }
4151
- function issueFromTask(task) {
4152
- if (task === undefined || task === "")
4153
- return null;
4154
- const n = Number(task);
4155
- return Number.isInteger(n) ? n : null;
4156
- }
4157
- function roundFromEnv(round) {
4158
- if (round === undefined || round === "")
4159
- return;
4160
- const n = Number(round);
4161
- return Number.isInteger(n) ? n : undefined;
4162
- }
4163
- function prFromEnv(pr) {
4164
- if (pr === undefined || pr === "")
4165
- return;
4166
- const n = Number(pr);
4167
- return Number.isInteger(n) && n > 0 ? n : undefined;
4168
- }
4169
- function buildHeader(input) {
4170
- const role = isRole(input.env.role) ? input.env.role : "unattributed";
4171
- const round = roundFromEnv(input.env.round);
4172
- const pr = prFromEnv(input.env.pr);
4173
- const subject = {
4174
- issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
4175
- role,
4176
- ...round !== undefined ? { round } : {},
4177
- ...pr !== undefined ? { pr } : {},
4178
- ...input.subject ?? {}
4179
- };
4180
- const issue = subject.issue;
4181
- return {
4182
- meta: {
4183
- schema: 4,
4184
- ts: input.now.toISOString(),
4185
- run_id: input.runId,
4186
- seq: input.seq,
4187
- repo: input.repo,
4188
- vinaya: input.vinaya,
4189
- doctrine: input.doctrine,
4190
- host: input.host,
4191
- machine: createHash2("sha256").update(input.hostname).digest("hex"),
4192
- event_id: input.eventId,
4193
- process_id: input.processId,
4194
- actor_id: actorIdFromEnv(input.env.role),
4195
- lineage: {
4196
- run: lineageFieldFromEnv(input.env.run),
4197
- attempt: attemptFromEnv(input.env.attempt),
4198
- parent: lineageFieldFromEnv(input.env.parent)
4199
- },
4200
- input_versions: {
4201
- manifest_version: input.inputVersions?.manifestVersion ?? null,
4202
- objectives_version: input.inputVersions?.objectivesVersion ?? null,
4203
- brief_hash: input.inputVersions?.briefHash ?? null,
4204
- ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
4205
- pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
4206
- policy_digest: input.inputVersions?.policyDigest ?? null
4207
- },
4208
- provenance: provenanceFor(input),
4209
- work: {
4210
- ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
4211
- repo: input.repo,
4212
- change: pr === undefined ? null : String(pr),
4213
- revision: input.revision ?? null
4214
- },
4215
- flow: {
4216
- id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
4217
- version: lineageFieldFromEnv(input.env.flowVersion)
4218
- },
4219
- runtime: lineageFieldFromEnv(input.env.runtime),
4220
- process: {
4221
- id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
4222
- version: lineageFieldFromEnv(input.env.processVersion),
4223
- digest: lineageFieldFromEnv(input.env.processDigest)
4224
- },
4225
- runner: {
4226
- id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
4227
- version: lineageFieldFromEnv(input.env.runnerVersion)
4228
- },
4229
- source: lineageFieldFromEnv(input.env.source)
4230
- },
4231
- subject
4232
- };
4233
- }
4234
- var init_envelope = __esm(() => {
4235
- init_schema();
4236
- });
4237
-
4238
4249
  // ../../harness/kernel/log/redact.ts
4239
4250
  function redactString(value, home) {
4240
4251
  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>");
@@ -4732,7 +4743,8 @@ function code(value) {
4732
4743
  return typeof value === "string" && CODE_TOKEN_PATTERN.test(value) ? value : null;
4733
4744
  }
4734
4745
  function roleSubject(value, sentenceStart = true) {
4735
- const name = typeof value === "string" && ROLE_VALUES.includes(value) ? `the ${value === "security" ? "security reviewer" : value.replace(/-/g, " ")}` : "a role";
4746
+ const known = typeof value === "string" ? lookupRole(value) : undefined;
4747
+ const name = known ? `the ${known.reading}` : "a role";
4736
4748
  return sentenceStart ? `${name[0]?.toUpperCase()}${name.slice(1)}` : name;
4737
4749
  }
4738
4750
  function roundLabel(record) {
@@ -4851,7 +4863,7 @@ function conflictReentry(record) {
4851
4863
  function dispatched(record) {
4852
4864
  const role = text(record.target_role);
4853
4865
  const who = roleSubject(role);
4854
- const reviewing = role === "code-reviewer" || role === "security";
4866
+ const reviewing = role !== null && (lookupRole(role)?.reviews ?? false);
4855
4867
  const round = whole(record.round);
4856
4868
  return {
4857
4869
  kind: "working",
@@ -4910,6 +4922,7 @@ function narrate(record, earlier = []) {
4910
4922
  }
4911
4923
  var REASONS, PAUSE_WITHOUT_CODE;
4912
4924
  var init_narration = __esm(() => {
4925
+ init_roles();
4913
4926
  init_schema();
4914
4927
  REASONS = {
4915
4928
  escalation: { words: "a role escalated a question", person: true },
@@ -4942,13 +4955,7 @@ var init_narration = __esm(() => {
4942
4955
 
4943
4956
  // ../../harness/kernel/adapters/agents/agent-line.ts
4944
4957
  function roleLabel(role) {
4945
- if (role in roleLabels)
4946
- return roleLabels[role];
4947
- if (role === "dev-review-loop")
4948
- return "Loop";
4949
- if (role === "operator")
4950
- return "Operator";
4951
- return role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4958
+ return lookupTitle(role) ?? role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4952
4959
  }
4953
4960
  function formatLineMeta(meta) {
4954
4961
  if (meta === undefined)
@@ -4962,17 +4969,9 @@ function formatAgentLine(role, words, options = {}) {
4962
4969
  const mark = options.unicode ?? true ? unicodeMarks[options.mark ?? "working"] : asciiMarks[options.mark ?? "working"];
4963
4970
  return `${time} ${mark} ${roleLabel(role)} ${words}`;
4964
4971
  }
4965
- var roleLabels, unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4972
+ var unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4966
4973
  var init_agent_line = __esm(() => {
4967
- roleLabels = {
4968
- planner: "Planner",
4969
- developer: "Developer",
4970
- "code-reviewer": "Code review",
4971
- security: "Security",
4972
- principal: "Principal",
4973
- archivist: "Archivist",
4974
- architect: "Architect"
4975
- };
4974
+ init_roles();
4976
4975
  unicodeMarks = { working: "▸", done: "✓", failed: "✕", waiting: "◌", round: "◆" };
4977
4976
  asciiMarks = { working: ">", done: "+", failed: "x", waiting: "~", round: "#" };
4978
4977
  META_KEY = /^[a-z]+$/;
@@ -6194,6 +6193,28 @@ var init_log_sink = __esm(() => {
6194
6193
  defaultSinkSlot = createDefaultLogSinkSlot(process.env.VINAYA_RUN_ID || randomUUID2());
6195
6194
  });
6196
6195
 
6196
+ // ../../harness/processes/vinaya-strict/integration/log/log-roles.ts
6197
+ function registerVinayaLogRoles() {
6198
+ for (const { name, reading, title, reviews } of VINAYA_LOG_ROLES)
6199
+ registerRole(name, { reading, title, reviews });
6200
+ registerTitle("dev-review-loop", "Loop");
6201
+ }
6202
+ var VINAYA_LOG_ROLES, VINAYA_LOG_ROLE_NAMES;
6203
+ var init_log_roles = __esm(() => {
6204
+ init_roles();
6205
+ VINAYA_LOG_ROLES = [
6206
+ { name: "planner", reading: "planner", title: "Planner", reviews: false },
6207
+ { name: "developer", reading: "developer", title: "Developer", reviews: false },
6208
+ { name: "code-reviewer", reading: "code reviewer", title: "Code review", reviews: true },
6209
+ { name: "security", reading: "security reviewer", title: "Security", reviews: true },
6210
+ { name: "principal", reading: "principal", title: "Principal", reviews: false },
6211
+ { name: "archivist", reading: "archivist", title: "Archivist", reviews: false },
6212
+ { name: "architect", reading: "architect", title: "Architect", reviews: false }
6213
+ ];
6214
+ VINAYA_LOG_ROLE_NAMES = VINAYA_LOG_ROLES.map((role) => role.name);
6215
+ registerVinayaLogRoles();
6216
+ });
6217
+
6197
6218
  // ../../harness/processes/vinaya-strict/integration/log/branch-issue.ts
6198
6219
  import { execFile as execFile5 } from "node:child_process";
6199
6220
  import { promisify as promisify5 } from "node:util";
@@ -6396,6 +6417,7 @@ function installVinayaLogSinkFactory() {
6396
6417
  var init_log_sink_factory = __esm(() => {
6397
6418
  init_log_sink();
6398
6419
  init_package_root();
6420
+ init_log_roles();
6399
6421
  init_branch_issue();
6400
6422
  init_doctrine_version();
6401
6423
  });
@@ -6801,8 +6823,8 @@ var init_protected_paths2 = __esm(() => {
6801
6823
 
6802
6824
  // ../../harness/processes/vinaya-strict/integration/policies/roles.ts
6803
6825
  var GRANTED_ROLES, ROLE_TOOL_GRANTS, VINAYA_TOOL_GRANTS, VINAYA_BROKER_ROLES, VINAYA_BOUNDARY_ROLES, OPERATOR_TOOL_GRANT, VINAYA_ROUTER_ROLES;
6804
- var init_roles = __esm(() => {
6805
- init_schema();
6826
+ var init_roles2 = __esm(() => {
6827
+ init_log_roles();
6806
6828
  GRANTED_ROLES = ["developer", "code-reviewer", "security", "controller"];
6807
6829
  ROLE_TOOL_GRANTS = {
6808
6830
  developer: [
@@ -6821,7 +6843,7 @@ var init_roles = __esm(() => {
6821
6843
  };
6822
6844
  VINAYA_TOOL_GRANTS = { roles: GRANTED_ROLES, grants: ROLE_TOOL_GRANTS };
6823
6845
  VINAYA_BROKER_ROLES = {
6824
- recognizedRoles: ROLE_VALUES,
6846
+ recognizedRoles: VINAYA_LOG_ROLE_NAMES,
6825
6847
  workerRoles: ["developer"],
6826
6848
  surfaceOwner: "the Planner"
6827
6849
  };
@@ -6905,7 +6927,7 @@ function vinayaRouterPolicies() {
6905
6927
  var init_vinaya_policies = __esm(() => {
6906
6928
  init_launch_records();
6907
6929
  init_protected_paths2();
6908
- init_roles();
6930
+ init_roles2();
6909
6931
  init_scratch_names();
6910
6932
  });
6911
6933
 
@@ -6992,7 +7014,9 @@ var init_programs = __esm(() => {
6992
7014
  program("log-selftest", `${P}/integration/bin/log-selftest.ts`, "dist/programs/log-selftest.js", [
6993
7015
  words("log", "selftest")
6994
7016
  ]),
6995
- program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")])
7017
+ program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")]),
7018
+ program("run-engine", `${P}/bin/run-engine.ts`, "dist/programs/run-engine.js"),
7019
+ program("supervised-command", `${P}/loops/dev-review/v2/supervised-command.ts`, "dist/programs/supervised-command.js")
6996
7020
  ]);
6997
7021
  SOURCE_ROOT = join13(dirname9(fileURLToPath4(import.meta.url)), "..", "..", "..", "..");
6998
7022
  FROM_SOURCE = fileURLToPath4(import.meta.url).endsWith(".ts");