@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
@@ -3829,21 +3829,145 @@ var init_resolve_repo = __esm(() => {
3829
3829
  };
3830
3830
  });
3831
3831
 
3832
+ // ../../harness/kernel/log/roles.ts
3833
+ function registerRole(name, role) {
3834
+ roles.set(name, role);
3835
+ }
3836
+ function registerTitle(name, title) {
3837
+ titles.set(name, title);
3838
+ }
3839
+ function isRole(value) {
3840
+ return value !== undefined && roles.has(value);
3841
+ }
3842
+ function lookupRole(name) {
3843
+ return roles.get(name);
3844
+ }
3845
+ function lookupTitle(name) {
3846
+ return roles.get(name)?.title ?? titles.get(name);
3847
+ }
3848
+ var roles, titles;
3849
+ var init_roles = __esm(() => {
3850
+ roles = new Map;
3851
+ titles = new Map;
3852
+ });
3853
+
3854
+ // ../../harness/kernel/log/envelope.ts
3855
+ import { createHash as createHash3 } from "node:crypto";
3856
+ function actorIdFromEnv(role) {
3857
+ return role === undefined || role === "" ? null : role;
3858
+ }
3859
+ function lineageFieldFromEnv(value) {
3860
+ return value === undefined || value === "" ? null : value;
3861
+ }
3862
+ function attemptFromEnv(value) {
3863
+ if (value === undefined || value === "")
3864
+ return null;
3865
+ const n = Number(value);
3866
+ return Number.isInteger(n) ? n : null;
3867
+ }
3868
+ function provenanceFor(input) {
3869
+ if (input.provenance)
3870
+ return input.provenance;
3871
+ if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
3872
+ return "unavailable";
3873
+ if (input.env.role || input.env.task)
3874
+ return "env_correlated";
3875
+ return "unavailable";
3876
+ }
3877
+ function issueFromTask(task) {
3878
+ if (task === undefined || task === "")
3879
+ return null;
3880
+ const n = Number(task);
3881
+ return Number.isInteger(n) ? n : null;
3882
+ }
3883
+ function roundFromEnv(round) {
3884
+ if (round === undefined || round === "")
3885
+ return;
3886
+ const n = Number(round);
3887
+ return Number.isInteger(n) ? n : undefined;
3888
+ }
3889
+ function prFromEnv(pr) {
3890
+ if (pr === undefined || pr === "")
3891
+ return;
3892
+ const n = Number(pr);
3893
+ return Number.isInteger(n) && n > 0 ? n : undefined;
3894
+ }
3895
+ function buildHeader(input) {
3896
+ const role = isRole(input.env.role) ? input.env.role : "unattributed";
3897
+ const round = roundFromEnv(input.env.round);
3898
+ const pr = prFromEnv(input.env.pr);
3899
+ const subject = {
3900
+ issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
3901
+ role,
3902
+ ...round !== undefined ? { round } : {},
3903
+ ...pr !== undefined ? { pr } : {},
3904
+ ...input.subject ?? {}
3905
+ };
3906
+ const issue = subject.issue;
3907
+ return {
3908
+ meta: {
3909
+ schema: 4,
3910
+ ts: input.now.toISOString(),
3911
+ run_id: input.runId,
3912
+ seq: input.seq,
3913
+ repo: input.repo,
3914
+ vinaya: input.vinaya,
3915
+ doctrine: input.doctrine,
3916
+ host: input.host,
3917
+ machine: createHash3("sha256").update(input.hostname).digest("hex"),
3918
+ event_id: input.eventId,
3919
+ process_id: input.processId,
3920
+ actor_id: actorIdFromEnv(input.env.role),
3921
+ lineage: {
3922
+ run: lineageFieldFromEnv(input.env.run),
3923
+ attempt: attemptFromEnv(input.env.attempt),
3924
+ parent: lineageFieldFromEnv(input.env.parent)
3925
+ },
3926
+ input_versions: {
3927
+ manifest_version: input.inputVersions?.manifestVersion ?? null,
3928
+ objectives_version: input.inputVersions?.objectivesVersion ?? null,
3929
+ brief_hash: input.inputVersions?.briefHash ?? null,
3930
+ ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
3931
+ pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
3932
+ policy_digest: input.inputVersions?.policyDigest ?? null
3933
+ },
3934
+ provenance: provenanceFor(input),
3935
+ work: {
3936
+ ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
3937
+ repo: input.repo,
3938
+ change: pr === undefined ? null : String(pr),
3939
+ revision: input.revision ?? null
3940
+ },
3941
+ flow: {
3942
+ id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
3943
+ version: lineageFieldFromEnv(input.env.flowVersion)
3944
+ },
3945
+ runtime: lineageFieldFromEnv(input.env.runtime),
3946
+ process: {
3947
+ id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
3948
+ version: lineageFieldFromEnv(input.env.processVersion),
3949
+ digest: lineageFieldFromEnv(input.env.processDigest)
3950
+ },
3951
+ runner: {
3952
+ id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
3953
+ version: lineageFieldFromEnv(input.env.runnerVersion)
3954
+ },
3955
+ source: lineageFieldFromEnv(input.env.source)
3956
+ },
3957
+ subject
3958
+ };
3959
+ }
3960
+ var init_envelope = __esm(() => {
3961
+ init_roles();
3962
+ });
3963
+
3832
3964
  // ../../harness/kernel/log/schema.ts
3833
3965
  import { z as z7 } from "zod";
3834
- 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;
3966
+ 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;
3835
3967
  var init_schema = __esm(() => {
3836
3968
  init_custom();
3837
- ROLE_VALUES = [
3838
- "planner",
3839
- "developer",
3840
- "code-reviewer",
3841
- "security",
3842
- "principal",
3843
- "archivist",
3844
- "architect"
3845
- ];
3846
- RoleSchema = z7.enum(ROLE_VALUES);
3969
+ ROLE_NAME_PATTERN = /^[a-z0-9-]+$/;
3970
+ RoleSchema = z7.string().regex(ROLE_NAME_PATTERN);
3847
3971
  HOST_VALUES = ["hook", "ci", "cli", "loop"];
3848
3972
  HostSchema = z7.enum(HOST_VALUES);
3849
3973
  RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
@@ -4425,119 +4549,6 @@ var init_schema = __esm(() => {
4425
4549
  ]);
4426
4550
  });
4427
4551
 
4428
- // ../../harness/kernel/log/envelope.ts
4429
- import { createHash as createHash3 } from "node:crypto";
4430
- function isRole(value) {
4431
- return value !== undefined && ROLE_VALUES.includes(value);
4432
- }
4433
- function actorIdFromEnv(role) {
4434
- return role === undefined || role === "" ? null : role;
4435
- }
4436
- function lineageFieldFromEnv(value) {
4437
- return value === undefined || value === "" ? null : value;
4438
- }
4439
- function attemptFromEnv(value) {
4440
- if (value === undefined || value === "")
4441
- return null;
4442
- const n = Number(value);
4443
- return Number.isInteger(n) ? n : null;
4444
- }
4445
- function provenanceFor(input) {
4446
- if (input.provenance)
4447
- return input.provenance;
4448
- if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
4449
- return "unavailable";
4450
- if (input.env.role || input.env.task)
4451
- return "env_correlated";
4452
- return "unavailable";
4453
- }
4454
- function issueFromTask(task) {
4455
- if (task === undefined || task === "")
4456
- return null;
4457
- const n = Number(task);
4458
- return Number.isInteger(n) ? n : null;
4459
- }
4460
- function roundFromEnv(round) {
4461
- if (round === undefined || round === "")
4462
- return;
4463
- const n = Number(round);
4464
- return Number.isInteger(n) ? n : undefined;
4465
- }
4466
- function prFromEnv(pr) {
4467
- if (pr === undefined || pr === "")
4468
- return;
4469
- const n = Number(pr);
4470
- return Number.isInteger(n) && n > 0 ? n : undefined;
4471
- }
4472
- function buildHeader(input) {
4473
- const role = isRole(input.env.role) ? input.env.role : "unattributed";
4474
- const round = roundFromEnv(input.env.round);
4475
- const pr = prFromEnv(input.env.pr);
4476
- const subject = {
4477
- issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
4478
- role,
4479
- ...round !== undefined ? { round } : {},
4480
- ...pr !== undefined ? { pr } : {},
4481
- ...input.subject ?? {}
4482
- };
4483
- const issue = subject.issue;
4484
- return {
4485
- meta: {
4486
- schema: 4,
4487
- ts: input.now.toISOString(),
4488
- run_id: input.runId,
4489
- seq: input.seq,
4490
- repo: input.repo,
4491
- vinaya: input.vinaya,
4492
- doctrine: input.doctrine,
4493
- host: input.host,
4494
- machine: createHash3("sha256").update(input.hostname).digest("hex"),
4495
- event_id: input.eventId,
4496
- process_id: input.processId,
4497
- actor_id: actorIdFromEnv(input.env.role),
4498
- lineage: {
4499
- run: lineageFieldFromEnv(input.env.run),
4500
- attempt: attemptFromEnv(input.env.attempt),
4501
- parent: lineageFieldFromEnv(input.env.parent)
4502
- },
4503
- input_versions: {
4504
- manifest_version: input.inputVersions?.manifestVersion ?? null,
4505
- objectives_version: input.inputVersions?.objectivesVersion ?? null,
4506
- brief_hash: input.inputVersions?.briefHash ?? null,
4507
- ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
4508
- pause_bound_ruling: input.inputVersions?.pauseBoundRuling ?? null,
4509
- policy_digest: input.inputVersions?.policyDigest ?? null
4510
- },
4511
- provenance: provenanceFor(input),
4512
- work: {
4513
- ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
4514
- repo: input.repo,
4515
- change: pr === undefined ? null : String(pr),
4516
- revision: input.revision ?? null
4517
- },
4518
- flow: {
4519
- id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
4520
- version: lineageFieldFromEnv(input.env.flowVersion)
4521
- },
4522
- runtime: lineageFieldFromEnv(input.env.runtime),
4523
- process: {
4524
- id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
4525
- version: lineageFieldFromEnv(input.env.processVersion),
4526
- digest: lineageFieldFromEnv(input.env.processDigest)
4527
- },
4528
- runner: {
4529
- id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
4530
- version: lineageFieldFromEnv(input.env.runnerVersion)
4531
- },
4532
- source: lineageFieldFromEnv(input.env.source)
4533
- },
4534
- subject
4535
- };
4536
- }
4537
- var init_envelope = __esm(() => {
4538
- init_schema();
4539
- });
4540
-
4541
4552
  // ../../harness/kernel/log/redact.ts
4542
4553
  function redactString(value, home) {
4543
4554
  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>");
@@ -4675,7 +4686,8 @@ function code(value) {
4675
4686
  return typeof value === "string" && CODE_TOKEN_PATTERN.test(value) ? value : null;
4676
4687
  }
4677
4688
  function roleSubject(value, sentenceStart = true) {
4678
- const name = typeof value === "string" && ROLE_VALUES.includes(value) ? `the ${value === "security" ? "security reviewer" : value.replace(/-/g, " ")}` : "a role";
4689
+ const known = typeof value === "string" ? lookupRole(value) : undefined;
4690
+ const name = known ? `the ${known.reading}` : "a role";
4679
4691
  return sentenceStart ? `${name[0]?.toUpperCase()}${name.slice(1)}` : name;
4680
4692
  }
4681
4693
  function roundLabel(record) {
@@ -4794,7 +4806,7 @@ function conflictReentry(record) {
4794
4806
  function dispatched(record) {
4795
4807
  const role = text(record.target_role);
4796
4808
  const who = roleSubject(role);
4797
- const reviewing = role === "code-reviewer" || role === "security";
4809
+ const reviewing = role !== null && (lookupRole(role)?.reviews ?? false);
4798
4810
  const round = whole(record.round);
4799
4811
  return {
4800
4812
  kind: "working",
@@ -4853,6 +4865,7 @@ function narrate(record, earlier = []) {
4853
4865
  }
4854
4866
  var REASONS, PAUSE_WITHOUT_CODE;
4855
4867
  var init_narration = __esm(() => {
4868
+ init_roles();
4856
4869
  init_schema();
4857
4870
  REASONS = {
4858
4871
  escalation: { words: "a role escalated a question", person: true },
@@ -4885,13 +4898,7 @@ var init_narration = __esm(() => {
4885
4898
 
4886
4899
  // ../../harness/kernel/adapters/agents/agent-line.ts
4887
4900
  function roleLabel(role) {
4888
- if (role in roleLabels)
4889
- return roleLabels[role];
4890
- if (role === "dev-review-loop")
4891
- return "Loop";
4892
- if (role === "operator")
4893
- return "Operator";
4894
- return role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4901
+ return lookupTitle(role) ?? role.replace(/-/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
4895
4902
  }
4896
4903
  function formatLineMeta(meta) {
4897
4904
  if (meta === undefined)
@@ -4905,17 +4912,9 @@ function formatAgentLine(role, words, options = {}) {
4905
4912
  const mark = options.unicode ?? true ? unicodeMarks[options.mark ?? "working"] : asciiMarks[options.mark ?? "working"];
4906
4913
  return `${time} ${mark} ${roleLabel(role)} ${words}`;
4907
4914
  }
4908
- var roleLabels, unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4915
+ var unicodeMarks, asciiMarks, META_KEY, META_VALUE;
4909
4916
  var init_agent_line = __esm(() => {
4910
- roleLabels = {
4911
- planner: "Planner",
4912
- developer: "Developer",
4913
- "code-reviewer": "Code review",
4914
- security: "Security",
4915
- principal: "Principal",
4916
- archivist: "Archivist",
4917
- architect: "Architect"
4918
- };
4917
+ init_roles();
4919
4918
  unicodeMarks = { working: "▸", done: "✓", failed: "✕", waiting: "◌", round: "◆" };
4920
4919
  asciiMarks = { working: ">", done: "+", failed: "x", waiting: "~", round: "#" };
4921
4920
  META_KEY = /^[a-z]+$/;
@@ -6137,6 +6136,28 @@ var init_log_sink = __esm(() => {
6137
6136
  defaultSinkSlot = createDefaultLogSinkSlot(process.env.VINAYA_RUN_ID || randomUUID2());
6138
6137
  });
6139
6138
 
6139
+ // ../../harness/processes/vinaya-strict/integration/log/log-roles.ts
6140
+ function registerVinayaLogRoles() {
6141
+ for (const { name, reading, title, reviews } of VINAYA_LOG_ROLES)
6142
+ registerRole(name, { reading, title, reviews });
6143
+ registerTitle("dev-review-loop", "Loop");
6144
+ }
6145
+ var VINAYA_LOG_ROLES, VINAYA_LOG_ROLE_NAMES;
6146
+ var init_log_roles = __esm(() => {
6147
+ init_roles();
6148
+ VINAYA_LOG_ROLES = [
6149
+ { name: "planner", reading: "planner", title: "Planner", reviews: false },
6150
+ { name: "developer", reading: "developer", title: "Developer", reviews: false },
6151
+ { name: "code-reviewer", reading: "code reviewer", title: "Code review", reviews: true },
6152
+ { name: "security", reading: "security reviewer", title: "Security", reviews: true },
6153
+ { name: "principal", reading: "principal", title: "Principal", reviews: false },
6154
+ { name: "archivist", reading: "archivist", title: "Archivist", reviews: false },
6155
+ { name: "architect", reading: "architect", title: "Architect", reviews: false }
6156
+ ];
6157
+ VINAYA_LOG_ROLE_NAMES = VINAYA_LOG_ROLES.map((role) => role.name);
6158
+ registerVinayaLogRoles();
6159
+ });
6160
+
6140
6161
  // ../../harness/processes/vinaya-strict/integration/log/branch-issue.ts
6141
6162
  import { execFile as execFile5 } from "node:child_process";
6142
6163
  import { promisify as promisify5 } from "node:util";
@@ -6339,6 +6360,7 @@ function installVinayaLogSinkFactory() {
6339
6360
  var init_log_sink_factory = __esm(() => {
6340
6361
  init_log_sink();
6341
6362
  init_package_root();
6363
+ init_log_roles();
6342
6364
  init_branch_issue();
6343
6365
  init_doctrine_version();
6344
6366
  });
@@ -6741,8 +6763,8 @@ var init_protected_paths2 = __esm(() => {
6741
6763
 
6742
6764
  // ../../harness/processes/vinaya-strict/integration/policies/roles.ts
6743
6765
  var GRANTED_ROLES, ROLE_TOOL_GRANTS, VINAYA_TOOL_GRANTS, VINAYA_BROKER_ROLES, VINAYA_BOUNDARY_ROLES, OPERATOR_TOOL_GRANT, VINAYA_ROUTER_ROLES;
6744
- var init_roles = __esm(() => {
6745
- init_schema();
6766
+ var init_roles2 = __esm(() => {
6767
+ init_log_roles();
6746
6768
  GRANTED_ROLES = ["developer", "code-reviewer", "security", "controller"];
6747
6769
  ROLE_TOOL_GRANTS = {
6748
6770
  developer: [
@@ -6761,7 +6783,7 @@ var init_roles = __esm(() => {
6761
6783
  };
6762
6784
  VINAYA_TOOL_GRANTS = { roles: GRANTED_ROLES, grants: ROLE_TOOL_GRANTS };
6763
6785
  VINAYA_BROKER_ROLES = {
6764
- recognizedRoles: ROLE_VALUES,
6786
+ recognizedRoles: VINAYA_LOG_ROLE_NAMES,
6765
6787
  workerRoles: ["developer"],
6766
6788
  surfaceOwner: "the Planner"
6767
6789
  };
@@ -6845,7 +6867,7 @@ function vinayaRouterPolicies() {
6845
6867
  var init_vinaya_policies = __esm(() => {
6846
6868
  init_launch_records();
6847
6869
  init_protected_paths2();
6848
- init_roles();
6870
+ init_roles2();
6849
6871
  init_scratch_names();
6850
6872
  });
6851
6873
 
@@ -3153,6 +3153,8 @@ function parseHunkRanges(patch) {
3153
3153
  }
3154
3154
  return { beforeRanges, afterRanges };
3155
3155
  }
3156
+ // ../../packages/test-selection/src/hunk-classes.ts
3157
+ var LOAD_ERROR_CODES = new Set([2300, 2392, 2393, 2440, 2448, 2449, 2450, 2451]);
3156
3158
  // ../../packages/test-selection/src/compiler-graph.ts
3157
3159
  import { createRequire } from "node:module";
3158
3160
  import { dirname as dirname4, join as join4, resolve as resolve2 } from "node:path";
@@ -3523,7 +3525,12 @@ var AT_CALLS = new Set([
3523
3525
  "execveat"
3524
3526
  ]);
3525
3527
  var CLONE_CALLS = new Set(["clone", "clone3", "fork", "vfork"]);
3528
+ var OPEN_CALLS = new Set(["open", "openat", "openat2", "creat"]);
3526
3529
  var GIT_PATH_READERS = new Set(["show", "cat-file", "rev-parse"]);
3530
+ // ../../packages/test-selection/src/selector.ts
3531
+ import { readdirSync, readFileSync as readFileSync4, statSync } from "node:fs";
3532
+ import { dirname as dirname7, extname, isAbsolute as isAbsolute5, join as join7, resolve as resolve5 } from "node:path";
3533
+
3527
3534
  // ../../packages/test-selection/src/scanner-inputs.ts
3528
3535
  import { dirname as dirname5, isAbsolute as isAbsolute3, join as join5, resolve as resolve3 } from "node:path";
3529
3536
  var TREE_READERS = new Set([
@@ -3679,9 +3686,6 @@ function startsProcessIn(ts, file, source, ranges) {
3679
3686
  ts.forEachChild(sourceFile, visit);
3680
3687
  return found;
3681
3688
  }
3682
- // ../../packages/test-selection/src/selector.ts
3683
- import { readdirSync, readFileSync as readFileSync4, statSync } from "node:fs";
3684
- import { dirname as dirname7, extname, isAbsolute as isAbsolute5, join as join7, resolve as resolve5 } from "node:path";
3685
3689
 
3686
3690
  // ../../packages/test-selection/src/spawn-inputs.ts
3687
3691
  import { dirname as dirname6, isAbsolute as isAbsolute4, join as join6, resolve as resolve4 } from "node:path";
@@ -4811,6 +4815,9 @@ function reaches(start, edges, changed, maxDepth = Number.POSITIVE_INFINITY) {
4811
4815
  }
4812
4816
  return null;
4813
4817
  }
4818
+
4819
+ // ../../packages/test-selection/src/recorder.ts
4820
+ var RECORDER_TIME_LIMIT_MS = 15 * 60000;
4814
4821
  // ../../harness/processes/vinaya-strict/integration/pre-push-selection.ts
4815
4822
  init_compose();
4816
4823
 
@@ -4987,13 +4994,18 @@ var SCANNER_DECLARATIONS = [
4987
4994
  roots: ["apps/cli/src/"],
4988
4995
  trigger: "content"
4989
4996
  },
4990
- { test: "apps/cli/tests/platform-independence.test.ts", roots: ["apps/cli/tests/"], trigger: "content" },
4997
+ { test: "apps/cli/tests/platform-independence.test.ts", roots: ["."], trigger: "content" },
4991
4998
  {
4992
4999
  test: "harness/processes/vinaya-strict/integration/conformance/unit/process-fixture-coverage.test.ts",
4993
5000
  roots: ["apps/cli/tests/", "harness/processes/"],
4994
5001
  trigger: "process-start"
4995
5002
  },
4996
5003
  { test: "harness/processes/vinaya-strict/tests/run-engine.test.ts", roots: ["."], trigger: "content" },
5004
+ {
5005
+ test: "harness/processes/vinaya-strict/tests/live-forge-seam.test.ts",
5006
+ roots: ["harness/processes/vinaya-strict/"],
5007
+ trigger: "content"
5008
+ },
4997
5009
  {
4998
5010
  test: "harness/kernel/dev-process-socket/loader/load-process.test.ts",
4999
5011
  roots: ["harness/processes/"],