@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
@@ -4040,21 +4040,145 @@ var init_resolve_repo = __esm(() => {
4040
4040
  };
4041
4041
  });
4042
4042
 
4043
+ // ../../harness/kernel/log/roles.ts
4044
+ function registerRole(name, role) {
4045
+ roles.set(name, role);
4046
+ }
4047
+ function registerTitle(name, title) {
4048
+ titles.set(name, title);
4049
+ }
4050
+ function isRole(value) {
4051
+ return value !== undefined && roles.has(value);
4052
+ }
4053
+ function lookupRole(name) {
4054
+ return roles.get(name);
4055
+ }
4056
+ function lookupTitle(name) {
4057
+ return roles.get(name)?.title ?? titles.get(name);
4058
+ }
4059
+ var roles, titles;
4060
+ var init_roles = __esm(() => {
4061
+ roles = new Map;
4062
+ titles = new Map;
4063
+ });
4064
+
4065
+ // ../../harness/kernel/log/envelope.ts
4066
+ import { createHash as createHash4 } from "node:crypto";
4067
+ function actorIdFromEnv(role) {
4068
+ return role === undefined || role === "" ? null : role;
4069
+ }
4070
+ function lineageFieldFromEnv(value) {
4071
+ return value === undefined || value === "" ? null : value;
4072
+ }
4073
+ function attemptFromEnv(value) {
4074
+ if (value === undefined || value === "")
4075
+ return null;
4076
+ const n = Number(value);
4077
+ return Number.isInteger(n) ? n : null;
4078
+ }
4079
+ function provenanceFor(input) {
4080
+ if (input.provenance)
4081
+ return input.provenance;
4082
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
4083
+ return "unavailable";
4084
+ if (input.env.role || input.env.task)
4085
+ return "env_correlated";
4086
+ return "unavailable";
4087
+ }
4088
+ function issueFromTask(task) {
4089
+ if (task === undefined || task === "")
4090
+ return null;
4091
+ const n = Number(task);
4092
+ return Number.isInteger(n) ? n : null;
4093
+ }
4094
+ function roundFromEnv(round) {
4095
+ if (round === undefined || round === "")
4096
+ return;
4097
+ const n = Number(round);
4098
+ return Number.isInteger(n) ? n : undefined;
4099
+ }
4100
+ function prFromEnv(pr) {
4101
+ if (pr === undefined || pr === "")
4102
+ return;
4103
+ const n = Number(pr);
4104
+ return Number.isInteger(n) && n > 0 ? n : undefined;
4105
+ }
4106
+ function buildHeader(input) {
4107
+ const role = isRole(input.env.role) ? input.env.role : "unattributed";
4108
+ const round = roundFromEnv(input.env.round);
4109
+ const pr = prFromEnv(input.env.pr);
4110
+ const subject = {
4111
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
4112
+ role,
4113
+ ...round !== undefined ? { round } : {},
4114
+ ...pr !== undefined ? { pr } : {},
4115
+ ...input.subject ?? {}
4116
+ };
4117
+ const issue = subject.issue;
4118
+ return {
4119
+ meta: {
4120
+ schema: 4,
4121
+ ts: input.now.toISOString(),
4122
+ run_id: input.runId,
4123
+ seq: input.seq,
4124
+ repo: input.repo,
4125
+ vinaya: input.vinaya,
4126
+ doctrine: input.doctrine,
4127
+ host: input.host,
4128
+ machine: createHash4("sha256").update(input.hostname).digest("hex"),
4129
+ event_id: input.eventId,
4130
+ process_id: input.processId,
4131
+ actor_id: actorIdFromEnv(input.env.role),
4132
+ lineage: {
4133
+ run: lineageFieldFromEnv(input.env.run),
4134
+ attempt: attemptFromEnv(input.env.attempt),
4135
+ parent: lineageFieldFromEnv(input.env.parent)
4136
+ },
4137
+ input_versions: {
4138
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
4139
+ objectives_version: input.inputVersions?.objectivesVersion ?? null,
4140
+ brief_hash: input.inputVersions?.briefHash ?? null,
4141
+ ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
4142
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
4143
+ policy_digest: input.inputVersions?.policyDigest ?? null
4144
+ },
4145
+ provenance: provenanceFor(input),
4146
+ work: {
4147
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
4148
+ repo: input.repo,
4149
+ change: pr === undefined ? null : String(pr),
4150
+ revision: input.revision ?? null
4151
+ },
4152
+ flow: {
4153
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
4154
+ version: lineageFieldFromEnv(input.env.flowVersion)
4155
+ },
4156
+ runtime: lineageFieldFromEnv(input.env.runtime),
4157
+ process: {
4158
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
4159
+ version: lineageFieldFromEnv(input.env.processVersion),
4160
+ digest: lineageFieldFromEnv(input.env.processDigest)
4161
+ },
4162
+ runner: {
4163
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
4164
+ version: lineageFieldFromEnv(input.env.runnerVersion)
4165
+ },
4166
+ source: lineageFieldFromEnv(input.env.source)
4167
+ },
4168
+ subject
4169
+ };
4170
+ }
4171
+ var init_envelope = __esm(() => {
4172
+ init_roles();
4173
+ });
4174
+
4043
4175
  // ../../harness/kernel/log/schema.ts
4044
4176
  import { z as z6 } from "zod";
4045
- 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;
4177
+ 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;
4046
4178
  var init_schema = __esm(() => {
4047
4179
  init_custom();
4048
- ROLE_VALUES = [
4049
- "planner",
4050
- "developer",
4051
- "code-reviewer",
4052
- "security",
4053
- "principal",
4054
- "archivist",
4055
- "architect"
4056
- ];
4057
- RoleSchema = z6.enum(ROLE_VALUES);
4180
+ ROLE_NAME_PATTERN = /^[a-z0-9-]+$/;
4181
+ RoleSchema = z6.string().regex(ROLE_NAME_PATTERN);
4058
4182
  HOST_VALUES = ["hook", "ci", "cli", "loop"];
4059
4183
  HostSchema = z6.enum(HOST_VALUES);
4060
4184
  RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
@@ -4636,119 +4760,6 @@ var init_schema = __esm(() => {
4636
4760
  ]);
4637
4761
  });
4638
4762
 
4639
- // ../../harness/kernel/log/envelope.ts
4640
- import { createHash as createHash4 } from "node:crypto";
4641
- function isRole(value) {
4642
- return value !== undefined && ROLE_VALUES.includes(value);
4643
- }
4644
- function actorIdFromEnv(role) {
4645
- return role === undefined || role === "" ? null : role;
4646
- }
4647
- function lineageFieldFromEnv(value) {
4648
- return value === undefined || value === "" ? null : value;
4649
- }
4650
- function attemptFromEnv(value) {
4651
- if (value === undefined || value === "")
4652
- return null;
4653
- const n = Number(value);
4654
- return Number.isInteger(n) ? n : null;
4655
- }
4656
- function provenanceFor(input) {
4657
- if (input.provenance)
4658
- return input.provenance;
4659
- if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
4660
- return "unavailable";
4661
- if (input.env.role || input.env.task)
4662
- return "env_correlated";
4663
- return "unavailable";
4664
- }
4665
- function issueFromTask(task) {
4666
- if (task === undefined || task === "")
4667
- return null;
4668
- const n = Number(task);
4669
- return Number.isInteger(n) ? n : null;
4670
- }
4671
- function roundFromEnv(round) {
4672
- if (round === undefined || round === "")
4673
- return;
4674
- const n = Number(round);
4675
- return Number.isInteger(n) ? n : undefined;
4676
- }
4677
- function prFromEnv(pr) {
4678
- if (pr === undefined || pr === "")
4679
- return;
4680
- const n = Number(pr);
4681
- return Number.isInteger(n) && n > 0 ? n : undefined;
4682
- }
4683
- function buildHeader(input) {
4684
- const role = isRole(input.env.role) ? input.env.role : "unattributed";
4685
- const round = roundFromEnv(input.env.round);
4686
- const pr = prFromEnv(input.env.pr);
4687
- const subject = {
4688
- issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
4689
- role,
4690
- ...round !== undefined ? { round } : {},
4691
- ...pr !== undefined ? { pr } : {},
4692
- ...input.subject ?? {}
4693
- };
4694
- const issue = subject.issue;
4695
- return {
4696
- meta: {
4697
- schema: 4,
4698
- ts: input.now.toISOString(),
4699
- run_id: input.runId,
4700
- seq: input.seq,
4701
- repo: input.repo,
4702
- vinaya: input.vinaya,
4703
- doctrine: input.doctrine,
4704
- host: input.host,
4705
- machine: createHash4("sha256").update(input.hostname).digest("hex"),
4706
- event_id: input.eventId,
4707
- process_id: input.processId,
4708
- actor_id: actorIdFromEnv(input.env.role),
4709
- lineage: {
4710
- run: lineageFieldFromEnv(input.env.run),
4711
- attempt: attemptFromEnv(input.env.attempt),
4712
- parent: lineageFieldFromEnv(input.env.parent)
4713
- },
4714
- input_versions: {
4715
- manifest_version: input.inputVersions?.manifestVersion ?? null,
4716
- objectives_version: input.inputVersions?.objectivesVersion ?? null,
4717
- brief_hash: input.inputVersions?.briefHash ?? null,
4718
- ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
4719
- pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
4720
- policy_digest: input.inputVersions?.policyDigest ?? null
4721
- },
4722
- provenance: provenanceFor(input),
4723
- work: {
4724
- ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
4725
- repo: input.repo,
4726
- change: pr === undefined ? null : String(pr),
4727
- revision: input.revision ?? null
4728
- },
4729
- flow: {
4730
- id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
4731
- version: lineageFieldFromEnv(input.env.flowVersion)
4732
- },
4733
- runtime: lineageFieldFromEnv(input.env.runtime),
4734
- process: {
4735
- id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
4736
- version: lineageFieldFromEnv(input.env.processVersion),
4737
- digest: lineageFieldFromEnv(input.env.processDigest)
4738
- },
4739
- runner: {
4740
- id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
4741
- version: lineageFieldFromEnv(input.env.runnerVersion)
4742
- },
4743
- source: lineageFieldFromEnv(input.env.source)
4744
- },
4745
- subject
4746
- };
4747
- }
4748
- var init_envelope = __esm(() => {
4749
- init_schema();
4750
- });
4751
-
4752
4763
  // ../../harness/kernel/log/redact.ts
4753
4764
  function redactString(value, home) {
4754
4765
  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>");
@@ -5255,7 +5266,8 @@ function code(value) {
5255
5266
  return typeof value === "string" && CODE_TOKEN_PATTERN.test(value) ? value : null;
5256
5267
  }
5257
5268
  function roleSubject(value, sentenceStart = true) {
5258
- const name = typeof value === "string" && ROLE_VALUES.includes(value) ? `the ${value === "security" ? "security reviewer" : value.replace(/-/g, " ")}` : "a role";
5269
+ const known = typeof value === "string" ? lookupRole(value) : undefined;
5270
+ const name = known ? `the ${known.reading}` : "a role";
5259
5271
  return sentenceStart ? `${name[0]?.toUpperCase()}${name.slice(1)}` : name;
5260
5272
  }
5261
5273
  function roundLabel(record) {
@@ -5374,7 +5386,7 @@ function conflictReentry(record) {
5374
5386
  function dispatched(record) {
5375
5387
  const role = text(record.target_role);
5376
5388
  const who = roleSubject(role);
5377
- const reviewing = role === "code-reviewer" || role === "security";
5389
+ const reviewing = role !== null && (lookupRole(role)?.reviews ?? false);
5378
5390
  const round = whole(record.round);
5379
5391
  return {
5380
5392
  kind: "working",
@@ -5433,6 +5445,7 @@ function narrate(record, earlier = []) {
5433
5445
  }
5434
5446
  var REASONS, PAUSE_WITHOUT_CODE;
5435
5447
  var init_narration = __esm(() => {
5448
+ init_roles();
5436
5449
  init_schema();
5437
5450
  REASONS = {
5438
5451
  escalation: { words: "a role escalated a question", person: true },
@@ -5465,13 +5478,7 @@ var init_narration = __esm(() => {
5465
5478
 
5466
5479
  // ../../harness/kernel/adapters/agents/agent-line.ts
5467
5480
  function roleLabel(role) {
5468
- if (role in roleLabels)
5469
- return roleLabels[role];
5470
- if (role === "dev-review-loop")
5471
- return "Loop";
5472
- if (role === "operator")
5473
- return "Operator";
5474
- return role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
5481
+ return lookupTitle(role) ?? role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
5475
5482
  }
5476
5483
  function formatLineMeta(meta) {
5477
5484
  if (meta === undefined)
@@ -5485,17 +5492,9 @@ function formatAgentLine(role, words, options = {}) {
5485
5492
  const mark = options.unicode ?? true ? unicodeMarks[options.mark ?? "working"] : asciiMarks[options.mark ?? "working"];
5486
5493
  return `${time} ${mark} ${roleLabel(role)} ${words}`;
5487
5494
  }
5488
- var roleLabels, unicodeMarks, asciiMarks, META_KEY, META_VALUE;
5495
+ var unicodeMarks, asciiMarks, META_KEY, META_VALUE;
5489
5496
  var init_agent_line = __esm(() => {
5490
- roleLabels = {
5491
- planner: "Planner",
5492
- developer: "Developer",
5493
- "code-reviewer": "Code review",
5494
- security: "Security",
5495
- principal: "Principal",
5496
- archivist: "Archivist",
5497
- architect: "Architect"
5498
- };
5497
+ init_roles();
5499
5498
  unicodeMarks = { working: "▸", done: "✓", failed: "✕", waiting: "◌", round: "◆" };
5500
5499
  asciiMarks = { working: ">", done: "+", failed: "x", waiting: "~", round: "#" };
5501
5500
  META_KEY = /^[a-z]+$/;
@@ -6807,6 +6806,28 @@ var init_install_process = __esm(() => {
6807
6806
  SLOT_ORDER = ["log", "config", "checks"];
6808
6807
  });
6809
6808
 
6809
+ // ../../harness/processes/vinaya-strict/integration/log/log-roles.ts
6810
+ function registerVinayaLogRoles() {
6811
+ for (const { name, reading, title, reviews } of VINAYA_LOG_ROLES)
6812
+ registerRole(name, { reading, title, reviews });
6813
+ registerTitle("dev-review-loop", "Loop");
6814
+ }
6815
+ var VINAYA_LOG_ROLES, VINAYA_LOG_ROLE_NAMES;
6816
+ var init_log_roles = __esm(() => {
6817
+ init_roles();
6818
+ VINAYA_LOG_ROLES = [
6819
+ { name: "planner", reading: "planner", title: "Planner", reviews: false },
6820
+ { name: "developer", reading: "developer", title: "Developer", reviews: false },
6821
+ { name: "code-reviewer", reading: "code reviewer", title: "Code review", reviews: true },
6822
+ { name: "security", reading: "security reviewer", title: "Security", reviews: true },
6823
+ { name: "principal", reading: "principal", title: "Principal", reviews: false },
6824
+ { name: "archivist", reading: "archivist", title: "Archivist", reviews: false },
6825
+ { name: "architect", reading: "architect", title: "Architect", reviews: false }
6826
+ ];
6827
+ VINAYA_LOG_ROLE_NAMES = VINAYA_LOG_ROLES.map((role) => role.name);
6828
+ registerVinayaLogRoles();
6829
+ });
6830
+
6810
6831
  // ../../harness/processes/vinaya-strict/integration/log/branch-issue.ts
6811
6832
  import { execFile as execFile7 } from "node:child_process";
6812
6833
  import { promisify as promisify7 } from "node:util";
@@ -7009,6 +7030,7 @@ function installVinayaLogSinkFactory() {
7009
7030
  var init_log_sink_factory = __esm(() => {
7010
7031
  init_log_sink();
7011
7032
  init_package_root();
7033
+ init_log_roles();
7012
7034
  init_branch_issue();
7013
7035
  init_doctrine_version();
7014
7036
  });
@@ -7408,8 +7430,8 @@ var init_protected_paths2 = __esm(() => {
7408
7430
 
7409
7431
  // ../../harness/processes/vinaya-strict/integration/policies/roles.ts
7410
7432
  var GRANTED_ROLES, ROLE_TOOL_GRANTS, VINAYA_TOOL_GRANTS, VINAYA_BROKER_ROLES, VINAYA_BOUNDARY_ROLES, OPERATOR_TOOL_GRANT, VINAYA_ROUTER_ROLES;
7411
- var init_roles = __esm(() => {
7412
- init_schema();
7433
+ var init_roles2 = __esm(() => {
7434
+ init_log_roles();
7413
7435
  GRANTED_ROLES = ["developer", "code-reviewer", "security", "controller"];
7414
7436
  ROLE_TOOL_GRANTS = {
7415
7437
  developer: [
@@ -7428,7 +7450,7 @@ var init_roles = __esm(() => {
7428
7450
  };
7429
7451
  VINAYA_TOOL_GRANTS = { roles: GRANTED_ROLES, grants: ROLE_TOOL_GRANTS };
7430
7452
  VINAYA_BROKER_ROLES = {
7431
- recognizedRoles: ROLE_VALUES,
7453
+ recognizedRoles: VINAYA_LOG_ROLE_NAMES,
7432
7454
  workerRoles: ["developer"],
7433
7455
  surfaceOwner: "the Planner"
7434
7456
  };
@@ -7512,7 +7534,7 @@ function vinayaRouterPolicies() {
7512
7534
  var init_vinaya_policies = __esm(() => {
7513
7535
  init_launch_records();
7514
7536
  init_protected_paths2();
7515
- init_roles();
7537
+ init_roles2();
7516
7538
  init_scratch_names();
7517
7539
  });
7518
7540
 
@@ -7599,7 +7621,9 @@ var init_programs = __esm(() => {
7599
7621
  program("log-selftest", `${P}/integration/bin/log-selftest.ts`, "dist/programs/log-selftest.js", [
7600
7622
  words("log", "selftest")
7601
7623
  ]),
7602
- program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")])
7624
+ program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")]),
7625
+ program("run-engine", `${P}/bin/run-engine.ts`, "dist/programs/run-engine.js"),
7626
+ program("supervised-command", `${P}/loops/dev-review/v2/supervised-command.ts`, "dist/programs/supervised-command.js")
7603
7627
  ]);
7604
7628
  SOURCE_ROOT = join16(dirname10(fileURLToPath4(import.meta.url)), "..", "..", "..", "..");
7605
7629
  FROM_SOURCE = fileURLToPath4(import.meta.url).endsWith(".ts");