@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
@@ -3874,21 +3874,145 @@ var init_fetch_documentation = __esm(() => {
3874
3874
  REQUEST_HEADER_ALLOWANCE = 64 * 1024;
3875
3875
  });
3876
3876
 
3877
+ // ../../harness/kernel/log/roles.ts
3878
+ function registerRole(name, role) {
3879
+ roles.set(name, role);
3880
+ }
3881
+ function registerTitle(name, title) {
3882
+ titles.set(name, title);
3883
+ }
3884
+ function isRole(value) {
3885
+ return value !== undefined && roles.has(value);
3886
+ }
3887
+ function lookupRole(name) {
3888
+ return roles.get(name);
3889
+ }
3890
+ function lookupTitle(name) {
3891
+ return roles.get(name)?.title ?? titles.get(name);
3892
+ }
3893
+ var roles, titles;
3894
+ var init_roles = __esm(() => {
3895
+ roles = new Map;
3896
+ titles = new Map;
3897
+ });
3898
+
3899
+ // ../../harness/kernel/log/envelope.ts
3900
+ import { createHash as createHash2 } from "node:crypto";
3901
+ function actorIdFromEnv(role) {
3902
+ return role === undefined || role === "" ? null : role;
3903
+ }
3904
+ function lineageFieldFromEnv(value) {
3905
+ return value === undefined || value === "" ? null : value;
3906
+ }
3907
+ function attemptFromEnv(value) {
3908
+ if (value === undefined || value === "")
3909
+ return null;
3910
+ const n = Number(value);
3911
+ return Number.isInteger(n) ? n : null;
3912
+ }
3913
+ function provenanceFor(input) {
3914
+ if (input.provenance)
3915
+ return input.provenance;
3916
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
3917
+ return "unavailable";
3918
+ if (input.env.role || input.env.task)
3919
+ return "env_correlated";
3920
+ return "unavailable";
3921
+ }
3922
+ function issueFromTask(task) {
3923
+ if (task === undefined || task === "")
3924
+ return null;
3925
+ const n = Number(task);
3926
+ return Number.isInteger(n) ? n : null;
3927
+ }
3928
+ function roundFromEnv(round) {
3929
+ if (round === undefined || round === "")
3930
+ return;
3931
+ const n = Number(round);
3932
+ return Number.isInteger(n) ? n : undefined;
3933
+ }
3934
+ function prFromEnv(pr) {
3935
+ if (pr === undefined || pr === "")
3936
+ return;
3937
+ const n = Number(pr);
3938
+ return Number.isInteger(n) && n > 0 ? n : undefined;
3939
+ }
3940
+ function buildHeader(input) {
3941
+ const role = isRole(input.env.role) ? input.env.role : "unattributed";
3942
+ const round = roundFromEnv(input.env.round);
3943
+ const pr = prFromEnv(input.env.pr);
3944
+ const subject = {
3945
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
3946
+ role,
3947
+ ...round !== undefined ? { round } : {},
3948
+ ...pr !== undefined ? { pr } : {},
3949
+ ...input.subject ?? {}
3950
+ };
3951
+ const issue = subject.issue;
3952
+ return {
3953
+ meta: {
3954
+ schema: 4,
3955
+ ts: input.now.toISOString(),
3956
+ run_id: input.runId,
3957
+ seq: input.seq,
3958
+ repo: input.repo,
3959
+ vinaya: input.vinaya,
3960
+ doctrine: input.doctrine,
3961
+ host: input.host,
3962
+ machine: createHash2("sha256").update(input.hostname).digest("hex"),
3963
+ event_id: input.eventId,
3964
+ process_id: input.processId,
3965
+ actor_id: actorIdFromEnv(input.env.role),
3966
+ lineage: {
3967
+ run: lineageFieldFromEnv(input.env.run),
3968
+ attempt: attemptFromEnv(input.env.attempt),
3969
+ parent: lineageFieldFromEnv(input.env.parent)
3970
+ },
3971
+ input_versions: {
3972
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
3973
+ objectives_version: input.inputVersions?.objectivesVersion ?? null,
3974
+ brief_hash: input.inputVersions?.briefHash ?? null,
3975
+ ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
3976
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
3977
+ policy_digest: input.inputVersions?.policyDigest ?? null
3978
+ },
3979
+ provenance: provenanceFor(input),
3980
+ work: {
3981
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
3982
+ repo: input.repo,
3983
+ change: pr === undefined ? null : String(pr),
3984
+ revision: input.revision ?? null
3985
+ },
3986
+ flow: {
3987
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
3988
+ version: lineageFieldFromEnv(input.env.flowVersion)
3989
+ },
3990
+ runtime: lineageFieldFromEnv(input.env.runtime),
3991
+ process: {
3992
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
3993
+ version: lineageFieldFromEnv(input.env.processVersion),
3994
+ digest: lineageFieldFromEnv(input.env.processDigest)
3995
+ },
3996
+ runner: {
3997
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
3998
+ version: lineageFieldFromEnv(input.env.runnerVersion)
3999
+ },
4000
+ source: lineageFieldFromEnv(input.env.source)
4001
+ },
4002
+ subject
4003
+ };
4004
+ }
4005
+ var init_envelope = __esm(() => {
4006
+ init_roles();
4007
+ });
4008
+
3877
4009
  // ../../harness/kernel/log/schema.ts
3878
4010
  import { z as z7 } from "zod";
3879
- 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;
4011
+ 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;
3880
4012
  var init_schema = __esm(() => {
3881
4013
  init_custom();
3882
- ROLE_VALUES = [
3883
- "planner",
3884
- "developer",
3885
- "code-reviewer",
3886
- "security",
3887
- "principal",
3888
- "archivist",
3889
- "architect"
3890
- ];
3891
- RoleSchema = z7.enum(ROLE_VALUES);
4014
+ ROLE_NAME_PATTERN = /^[a-z0-9-]+$/;
4015
+ RoleSchema = z7.string().regex(ROLE_NAME_PATTERN);
3892
4016
  HOST_VALUES = ["hook", "ci", "cli", "loop"];
3893
4017
  HostSchema = z7.enum(HOST_VALUES);
3894
4018
  RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
@@ -4470,119 +4594,6 @@ var init_schema = __esm(() => {
4470
4594
  ]);
4471
4595
  });
4472
4596
 
4473
- // ../../harness/kernel/log/envelope.ts
4474
- import { createHash as createHash2 } from "node:crypto";
4475
- function isRole(value) {
4476
- return value !== undefined && ROLE_VALUES.includes(value);
4477
- }
4478
- function actorIdFromEnv(role) {
4479
- return role === undefined || role === "" ? null : role;
4480
- }
4481
- function lineageFieldFromEnv(value) {
4482
- return value === undefined || value === "" ? null : value;
4483
- }
4484
- function attemptFromEnv(value) {
4485
- if (value === undefined || value === "")
4486
- return null;
4487
- const n = Number(value);
4488
- return Number.isInteger(n) ? n : null;
4489
- }
4490
- function provenanceFor(input) {
4491
- if (input.provenance)
4492
- return input.provenance;
4493
- if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
4494
- return "unavailable";
4495
- if (input.env.role || input.env.task)
4496
- return "env_correlated";
4497
- return "unavailable";
4498
- }
4499
- function issueFromTask(task) {
4500
- if (task === undefined || task === "")
4501
- return null;
4502
- const n = Number(task);
4503
- return Number.isInteger(n) ? n : null;
4504
- }
4505
- function roundFromEnv(round) {
4506
- if (round === undefined || round === "")
4507
- return;
4508
- const n = Number(round);
4509
- return Number.isInteger(n) ? n : undefined;
4510
- }
4511
- function prFromEnv(pr) {
4512
- if (pr === undefined || pr === "")
4513
- return;
4514
- const n = Number(pr);
4515
- return Number.isInteger(n) && n > 0 ? n : undefined;
4516
- }
4517
- function buildHeader(input) {
4518
- const role = isRole(input.env.role) ? input.env.role : "unattributed";
4519
- const round = roundFromEnv(input.env.round);
4520
- const pr = prFromEnv(input.env.pr);
4521
- const subject = {
4522
- issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
4523
- role,
4524
- ...round !== undefined ? { round } : {},
4525
- ...pr !== undefined ? { pr } : {},
4526
- ...input.subject ?? {}
4527
- };
4528
- const issue = subject.issue;
4529
- return {
4530
- meta: {
4531
- schema: 4,
4532
- ts: input.now.toISOString(),
4533
- run_id: input.runId,
4534
- seq: input.seq,
4535
- repo: input.repo,
4536
- vinaya: input.vinaya,
4537
- doctrine: input.doctrine,
4538
- host: input.host,
4539
- machine: createHash2("sha256").update(input.hostname).digest("hex"),
4540
- event_id: input.eventId,
4541
- process_id: input.processId,
4542
- actor_id: actorIdFromEnv(input.env.role),
4543
- lineage: {
4544
- run: lineageFieldFromEnv(input.env.run),
4545
- attempt: attemptFromEnv(input.env.attempt),
4546
- parent: lineageFieldFromEnv(input.env.parent)
4547
- },
4548
- input_versions: {
4549
- manifest_version: input.inputVersions?.manifestVersion ?? null,
4550
- objectives_version: input.inputVersions?.objectivesVersion ?? null,
4551
- brief_hash: input.inputVersions?.briefHash ?? null,
4552
- ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
4553
- pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
4554
- policy_digest: input.inputVersions?.policyDigest ?? null
4555
- },
4556
- provenance: provenanceFor(input),
4557
- work: {
4558
- ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
4559
- repo: input.repo,
4560
- change: pr === undefined ? null : String(pr),
4561
- revision: input.revision ?? null
4562
- },
4563
- flow: {
4564
- id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
4565
- version: lineageFieldFromEnv(input.env.flowVersion)
4566
- },
4567
- runtime: lineageFieldFromEnv(input.env.runtime),
4568
- process: {
4569
- id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
4570
- version: lineageFieldFromEnv(input.env.processVersion),
4571
- digest: lineageFieldFromEnv(input.env.processDigest)
4572
- },
4573
- runner: {
4574
- id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
4575
- version: lineageFieldFromEnv(input.env.runnerVersion)
4576
- },
4577
- source: lineageFieldFromEnv(input.env.source)
4578
- },
4579
- subject
4580
- };
4581
- }
4582
- var init_envelope = __esm(() => {
4583
- init_schema();
4584
- });
4585
-
4586
4597
  // ../../harness/kernel/log/store.ts
4587
4598
  function metaOf(obj) {
4588
4599
  if (obj === null || typeof obj !== "object")
@@ -4688,7 +4699,8 @@ function code(value) {
4688
4699
  return typeof value === "string" && CODE_TOKEN_PATTERN.test(value) ? value : null;
4689
4700
  }
4690
4701
  function roleSubject(value, sentenceStart = true) {
4691
- const name = typeof value === "string" && ROLE_VALUES.includes(value) ? `the ${value === "security" ? "security reviewer" : value.replace(/-/g, " ")}` : "a role";
4702
+ const known = typeof value === "string" ? lookupRole(value) : undefined;
4703
+ const name = known ? `the ${known.reading}` : "a role";
4692
4704
  return sentenceStart ? `${name[0]?.toUpperCase()}${name.slice(1)}` : name;
4693
4705
  }
4694
4706
  function roundLabel(record) {
@@ -4807,7 +4819,7 @@ function conflictReentry(record) {
4807
4819
  function dispatched(record) {
4808
4820
  const role = text(record.target_role);
4809
4821
  const who = roleSubject(role);
4810
- const reviewing = role === "code-reviewer" || role === "security";
4822
+ const reviewing = role !== null && (lookupRole(role)?.reviews ?? false);
4811
4823
  const round = whole(record.round);
4812
4824
  return {
4813
4825
  kind: "working",
@@ -4866,6 +4878,7 @@ function narrate(record, earlier = []) {
4866
4878
  }
4867
4879
  var REASONS, PAUSE_WITHOUT_CODE;
4868
4880
  var init_narration = __esm(() => {
4881
+ init_roles();
4869
4882
  init_schema();
4870
4883
  REASONS = {
4871
4884
  escalation: { words: "a role escalated a question", person: true },
@@ -4898,13 +4911,7 @@ var init_narration = __esm(() => {
4898
4911
 
4899
4912
  // ../../harness/kernel/adapters/agents/agent-line.ts
4900
4913
  function roleLabel(role) {
4901
- if (role in roleLabels)
4902
- return roleLabels[role];
4903
- if (role === "dev-review-loop")
4904
- return "Loop";
4905
- if (role === "operator")
4906
- return "Operator";
4907
- return role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4914
+ return lookupTitle(role) ?? role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4908
4915
  }
4909
4916
  function formatLineMeta(meta) {
4910
4917
  if (meta === undefined)
@@ -4918,17 +4925,9 @@ function formatAgentLine(role, words, options = {}) {
4918
4925
  const mark = options.unicode ?? true ? unicodeMarks[options.mark ?? "working"] : asciiMarks[options.mark ?? "working"];
4919
4926
  return `${time} ${mark} ${roleLabel(role)} ${words}`;
4920
4927
  }
4921
- var roleLabels, unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4928
+ var unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4922
4929
  var init_agent_line = __esm(() => {
4923
- roleLabels = {
4924
- planner: "Planner",
4925
- developer: "Developer",
4926
- "code-reviewer": "Code review",
4927
- security: "Security",
4928
- principal: "Principal",
4929
- archivist: "Archivist",
4930
- architect: "Architect"
4931
- };
4930
+ init_roles();
4932
4931
  unicodeMarks = { working: "▸", done: "✓", failed: "✕", waiting: "◌", round: "◆" };
4933
4932
  asciiMarks = { working: ">", done: "+", failed: "x", waiting: "~", round: "#" };
4934
4933
  META_KEY = /^[a-z]+$/;
@@ -6150,6 +6149,28 @@ var init_log_sink = __esm(() => {
6150
6149
  defaultSinkSlot = createDefaultLogSinkSlot(process.env.VINAYA_RUN_ID || randomUUID2());
6151
6150
  });
6152
6151
 
6152
+ // ../../harness/processes/vinaya-strict/integration/log/log-roles.ts
6153
+ function registerVinayaLogRoles() {
6154
+ for (const { name, reading, title, reviews } of VINAYA_LOG_ROLES)
6155
+ registerRole(name, { reading, title, reviews });
6156
+ registerTitle("dev-review-loop", "Loop");
6157
+ }
6158
+ var VINAYA_LOG_ROLES, VINAYA_LOG_ROLE_NAMES;
6159
+ var init_log_roles = __esm(() => {
6160
+ init_roles();
6161
+ VINAYA_LOG_ROLES = [
6162
+ { name: "planner", reading: "planner", title: "Planner", reviews: false },
6163
+ { name: "developer", reading: "developer", title: "Developer", reviews: false },
6164
+ { name: "code-reviewer", reading: "code reviewer", title: "Code review", reviews: true },
6165
+ { name: "security", reading: "security reviewer", title: "Security", reviews: true },
6166
+ { name: "principal", reading: "principal", title: "Principal", reviews: false },
6167
+ { name: "archivist", reading: "archivist", title: "Archivist", reviews: false },
6168
+ { name: "architect", reading: "architect", title: "Architect", reviews: false }
6169
+ ];
6170
+ VINAYA_LOG_ROLE_NAMES = VINAYA_LOG_ROLES.map((role) => role.name);
6171
+ registerVinayaLogRoles();
6172
+ });
6173
+
6153
6174
  // ../../harness/processes/vinaya-strict/integration/log/branch-issue.ts
6154
6175
  import { execFile as execFile5 } from "node:child_process";
6155
6176
  import { promisify as promisify5 } from "node:util";
@@ -6352,6 +6373,7 @@ function installVinayaLogSinkFactory() {
6352
6373
  var init_log_sink_factory = __esm(() => {
6353
6374
  init_log_sink();
6354
6375
  init_package_root();
6376
+ init_log_roles();
6355
6377
  init_branch_issue();
6356
6378
  init_doctrine_version();
6357
6379
  });
@@ -6816,8 +6838,8 @@ var init_protected_paths2 = __esm(() => {
6816
6838
 
6817
6839
  // ../../harness/processes/vinaya-strict/integration/policies/roles.ts
6818
6840
  var GRANTED_ROLES, ROLE_TOOL_GRANTS, VINAYA_TOOL_GRANTS, VINAYA_BROKER_ROLES, VINAYA_BOUNDARY_ROLES, OPERATOR_TOOL_GRANT, VINAYA_ROUTER_ROLES;
6819
- var init_roles = __esm(() => {
6820
- init_schema();
6841
+ var init_roles2 = __esm(() => {
6842
+ init_log_roles();
6821
6843
  GRANTED_ROLES = ["developer", "code-reviewer", "security", "controller"];
6822
6844
  ROLE_TOOL_GRANTS = {
6823
6845
  developer: [
@@ -6836,7 +6858,7 @@ var init_roles = __esm(() => {
6836
6858
  };
6837
6859
  VINAYA_TOOL_GRANTS = { roles: GRANTED_ROLES, grants: ROLE_TOOL_GRANTS };
6838
6860
  VINAYA_BROKER_ROLES = {
6839
- recognizedRoles: ROLE_VALUES,
6861
+ recognizedRoles: VINAYA_LOG_ROLE_NAMES,
6840
6862
  workerRoles: ["developer"],
6841
6863
  surfaceOwner: "the Planner"
6842
6864
  };
@@ -6920,7 +6942,7 @@ function vinayaRouterPolicies() {
6920
6942
  var init_vinaya_policies = __esm(() => {
6921
6943
  init_launch_records();
6922
6944
  init_protected_paths2();
6923
- init_roles();
6945
+ init_roles2();
6924
6946
  init_scratch_names();
6925
6947
  });
6926
6948
 
@@ -7007,7 +7029,9 @@ var init_programs = __esm(() => {
7007
7029
  program("log-selftest", `${P}/integration/bin/log-selftest.ts`, "dist/programs/log-selftest.js", [
7008
7030
  words("log", "selftest")
7009
7031
  ]),
7010
- program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")])
7032
+ program("sync", `${P}/integration/bin/sync.ts`, "dist/programs/sync.js", [words("sync")]),
7033
+ program("run-engine", `${P}/bin/run-engine.ts`, "dist/programs/run-engine.js"),
7034
+ program("supervised-command", `${P}/loops/dev-review/v2/supervised-command.ts`, "dist/programs/supervised-command.js")
7011
7035
  ]);
7012
7036
  SOURCE_ROOT = join13(dirname10(fileURLToPath4(import.meta.url)), "..", "..", "..", "..");
7013
7037
  FROM_SOURCE = fileURLToPath4(import.meta.url).endsWith(".ts");
@@ -7352,6 +7376,14 @@ init_premise_check();
7352
7376
 
7353
7377
  // ../../harness/processes/vinaya-strict/loops/dev-review/standalone/dev-review-loop/gate-reading.ts
7354
7378
  init_round_assess();
7379
+
7380
+ // ../../harness/processes/vinaya-strict/loops/dev-review/v2/git-read-memo.ts
7381
+ var MEMOIZED = new Set(["rev-parse", "merge-base", "show-ref", "for-each-ref", "rev-list"]);
7382
+ var READ_ONLY_UNKEPT = new Set(["ls-remote", "status", "diff", "ls-files", "log", "show", "cat-file", "merge-tree"]);
7383
+ var state = { scopes: 0, turns: 0, entries: new Map, listeners: new Set };
7384
+ var wrapped = new WeakMap;
7385
+
7386
+ // ../../harness/processes/vinaya-strict/loops/dev-review/standalone/dev-review-loop/gate-reading.ts
7355
7387
  var MAX_GH_OUTPUT_BYTES = 64 * 1024 * 1024;
7356
7388
 
7357
7389
  // ../../harness/processes/vinaya-strict/loops/dev-review/standalone/dev-review-loop/developer-dispatch.ts