opencode-swarm 7.173.1 → 7.174.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 (103) hide show
  1. package/.opencode/skills/swarm-pr-review/references/findings-persistence-contract.md +37 -0
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/agents/critic.d.ts +44 -2
  5. package/dist/background/pr-review-contract.d.ts +24 -0
  6. package/dist/background/stage-b-gates.d.ts +29 -0
  7. package/dist/cli/{coder-settlement-kxxmd9jt.js → coder-settlement-pwct8te4.js} +11 -11
  8. package/dist/cli/{config-doctor-nzcya5zr.js → config-doctor-tnta65bf.js} +2 -2
  9. package/dist/cli/{core-s9a9kmcc.js → core-421gbna2.js} +3 -3
  10. package/dist/cli/{curation-policy-tx4kb30e.js → curation-policy-dw25zm05.js} +5 -5
  11. package/dist/cli/{curator-drift-047n8fjw.js → curator-drift-x3tt8apf.js} +4 -4
  12. package/dist/cli/curator-llm-factory-4e73613g.js +72 -0
  13. package/dist/cli/{curator-jkp8558s.js → curator-yrhc4epa.js} +36 -36
  14. package/dist/cli/{evidence-summary-service-ek50h5b3.js → evidence-summary-service-f4vem356.js} +15 -15
  15. package/dist/cli/{gate-evidence-8dk50ten.js → gate-evidence-t2dyfvc4.js} +6 -6
  16. package/dist/cli/guardrail-explain-hf5gawe2.js +73 -0
  17. package/dist/cli/{guardrail-log-hq5xpm7g.js → guardrail-log-9dkyvdbw.js} +7 -7
  18. package/dist/cli/{guardrail-reset-gttz1y0h.js → guardrail-reset-26bxnh2e.js} +36 -36
  19. package/dist/cli/{hive-promoter-44p7ng87.js → hive-promoter-6s6xbq5x.js} +36 -36
  20. package/dist/cli/{index-gwz9p53s.js → index-0c7y177k.js} +2 -2
  21. package/dist/cli/{index-m53v442a.js → index-23fwhwrb.js} +36 -36
  22. package/dist/cli/{index-p36b6t7w.js → index-2qawngxn.js} +8 -8
  23. package/dist/cli/{index-fnx0jzf7.js → index-2xwavnbg.js} +1 -1
  24. package/dist/cli/{index-z35ynvj4.js → index-3yw5h3bt.js} +1 -1
  25. package/dist/cli/{index-jmn35na4.js → index-5prgmf00.js} +3 -3
  26. package/dist/cli/{index-za1kvsa0.js → index-5t71wd7j.js} +2 -2
  27. package/dist/cli/{index-dktpzjy9.js → index-6tbnev6y.js} +1 -1
  28. package/dist/cli/{index-yzwb6ja4.js → index-6v1cz898.js} +1 -1
  29. package/dist/cli/{index-yeehyat1.js → index-8d3qzvbb.js} +2 -2
  30. package/dist/cli/{index-bsnpv4xd.js → index-8tn4yx8b.js} +2 -2
  31. package/dist/cli/{index-pynk60z5.js → index-9gpf4tt4.js} +8 -8
  32. package/dist/cli/{index-62pcs7jg.js → index-bf6w27sb.js} +3 -3
  33. package/dist/cli/{index-ndvgkxpf.js → index-c60t3sw6.js} +2 -2
  34. package/dist/cli/{index-m51cmzxt.js → index-cw1nbtvh.js} +1 -1
  35. package/dist/cli/{index-evf5r7bk.js → index-czhbsgdh.js} +1 -1
  36. package/dist/cli/{index-53c0ajk4.js → index-ddz0a0ew.js} +1 -1
  37. package/dist/cli/{index-c5nrcde1.js → index-dfd6d64k.js} +38 -38
  38. package/dist/cli/{index-1xfxzjq9.js → index-dfey3jpn.js} +2 -2
  39. package/dist/cli/{index-gwtb07gc.js → index-e4g3487s.js} +3 -3
  40. package/dist/cli/{index-psb9rxt8.js → index-fagcasf8.js} +5 -5
  41. package/dist/cli/{index-18b9snn6.js → index-hkx8tqa4.js} +6 -6
  42. package/dist/cli/{index-wf3s2t1t.js → index-jd2f7thw.js} +2567 -2138
  43. package/dist/cli/{index-0dfhahxm.js → index-jj09bfnn.js} +2 -2
  44. package/dist/cli/{index-wr4m11x4.js → index-kj7h2yfv.js} +1 -1
  45. package/dist/cli/{index-90qbc4rp.js → index-kyakvkpk.js} +10 -3
  46. package/dist/cli/{index-r8g2meas.js → index-m8c44754.js} +5 -3
  47. package/dist/cli/{index-43dmpa9w.js → index-mjtja1wq.js} +2 -2
  48. package/dist/cli/{index-r93ptj7j.js → index-mmnk7nt1.js} +19 -1
  49. package/dist/cli/{index-hhws1xkc.js → index-nwew2anc.js} +1 -1
  50. package/dist/cli/{index-dx9pz5n6.js → index-nxnmy2da.js} +7 -7
  51. package/dist/cli/{index-j0vvq8se.js → index-py58gern.js} +7 -7
  52. package/dist/cli/{index-6z404f7y.js → index-qc4nvg0m.js} +4 -4
  53. package/dist/cli/{index-samx6zgc.js → index-rgvg7d6k.js} +1 -1
  54. package/dist/cli/{index-mt8pbzda.js → index-rjjtn1w5.js} +12 -12
  55. package/dist/cli/{index-cm0339fe.js → index-s6wb6sjk.js} +4 -4
  56. package/dist/cli/{index-vwnd2szd.js → index-saw0ambb.js} +10 -7
  57. package/dist/cli/{index-pjw95rxm.js → index-snd34n1y.js} +65 -10
  58. package/dist/cli/{index-mjqjbq94.js → index-v8ykb3hq.js} +11 -11
  59. package/dist/cli/{index-kdyvk541.js → index-vsvdh976.js} +2 -2
  60. package/dist/cli/{index-7gkdxs00.js → index-vwjfm0s6.js} +7 -7
  61. package/dist/cli/index.js +37 -37
  62. package/dist/cli/{knowledge-escalator-ttp4x29h.js → knowledge-escalator-bra0fkfm.js} +12 -12
  63. package/dist/cli/{knowledge-events-dx9mjgqb.js → knowledge-events-v4hq7wr9.js} +10 -10
  64. package/dist/cli/{knowledge-link-f7bhq7cx.js → knowledge-link-dw12x2ns.js} +4 -4
  65. package/dist/cli/{knowledge-store-6sq9rxma.js → knowledge-store-3hx2896s.js} +5 -5
  66. package/dist/cli/{knowledge-validator-h49dkw2z.js → knowledge-validator-9wj31ym5.js} +7 -7
  67. package/dist/cli/{mcp-kd7w2572.js → mcp-d7yptqpg.js} +1 -1
  68. package/dist/cli/{pending-delegations-n4qyymj2.js → pending-delegations-8ghc75b2.js} +11 -11
  69. package/dist/cli/{pr-subscriptions-n8vkm5mv.js → pr-subscriptions-yceed093.js} +11 -11
  70. package/dist/cli/{pr-workflow-gate-j67jhtzt.js → pr-workflow-gate-sc4c4cmk.js} +42 -36
  71. package/dist/cli/{runner-58k70bnr.js → runner-k1pmc3z8.js} +5 -5
  72. package/dist/cli/{scan-cursor-sz8ncpw2.js → scan-cursor-mtja4626.js} +6 -6
  73. package/dist/cli/{schema-70c0yw8p.js → schema-x2nb18fg.js} +5 -1
  74. package/dist/cli/{scope-persistence-0dzyv0vt.js → scope-persistence-tafxf6yz.js} +14 -14
  75. package/dist/cli/{server-njmemwbm.js → server-hk378mzc.js} +36 -36
  76. package/dist/cli/{skill-generator-kf5yqmvk.js → skill-generator-vz5vtgk6.js} +14 -14
  77. package/dist/cli/{snapshot-coordination-init-ezf5xqy2.js → snapshot-coordination-init-8x5n1q8c.js} +36 -36
  78. package/dist/cli/{telemetry-zed80n86.js → telemetry-m580862y.js} +1 -1
  79. package/dist/cli/{workspace-snapshot-62be4368.js → workspace-snapshot-6aw002e8.js} +3 -3
  80. package/dist/cli/{worktree-collision-ownership-fe176vyv.js → worktree-collision-ownership-cfx1tsaf.js} +12 -12
  81. package/dist/cli/{worktree-isolation-c0b1h3f1.js → worktree-isolation-t3fm1c5w.js} +36 -36
  82. package/dist/config/index.d.ts +2 -2
  83. package/dist/config/schema.d.ts +22 -8
  84. package/dist/events/core-events.d.ts +2 -0
  85. package/dist/evidence/task-gate-requirements.d.ts +24 -0
  86. package/dist/gate-evidence.d.ts +12 -0
  87. package/dist/hooks/pr-workflow-gate.d.ts +22 -0
  88. package/dist/index.d.ts +8 -0
  89. package/dist/index.js +481 -469
  90. package/dist/parallel/review-router.d.ts +8 -2
  91. package/dist/pr-review/completion.d.ts +2 -1
  92. package/dist/pr-review/finding-policy.d.ts +194 -0
  93. package/dist/review/routing-enforcement.d.ts +163 -0
  94. package/dist/session/snapshot-writer.d.ts +2 -0
  95. package/dist/state.d.ts +28 -0
  96. package/dist/tools/complete-pr-workflow.d.ts +2 -1
  97. package/dist/tools/tool-metadata.d.ts +16 -16
  98. package/dist/tools/update-task-status.d.ts +0 -10
  99. package/dist/tools/write-pr-review-artifact.d.ts +7 -0
  100. package/opencode-swarm.schema.json +11 -0
  101. package/package.json +1 -1
  102. package/dist/cli/curator-llm-factory-dza1qtwr.js +0 -72
  103. package/dist/cli/guardrail-explain-s29vngen.js +0 -73
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-evf5r7bk.js";
4
+ } from "./index-czhbsgdh.js";
5
5
  import {
6
6
  atomicWriteSwarmFileSync
7
- } from "./index-bsnpv4xd.js";
7
+ } from "./index-8tn4yx8b.js";
8
8
 
9
9
  // src/hooks/delegation-gate/worktree-provisioning-owner.ts
10
10
  import { createHash } from "crypto";
@@ -5,7 +5,7 @@ import {
5
5
  batchDurabilityClass,
6
6
  classifyDbWriteError,
7
7
  getProjectDb
8
- } from "./index-dktpzjy9.js";
8
+ } from "./index-6tbnev6y.js";
9
9
  import {
10
10
  _internals,
11
11
  canonicalRootKeyFresh
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.173.1",
24
+ version: "7.174.0",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",
@@ -324,7 +324,7 @@ function resolveExternalSkillsConfig(input) {
324
324
  };
325
325
  return merged;
326
326
  }
327
- var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewFinalConfigSchema, AutoReviewConfigObjectSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, HarnessRelativePathSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY = false, PluginConfigSchema;
327
+ var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewFinalConfigSchema, AutoReviewConfigObjectSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, HarnessRelativePathSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY = false, PluginConfigSchema;
328
328
  var init_schema = __esm(() => {
329
329
  init_zod();
330
330
  init_package();
@@ -1670,6 +1670,12 @@ var init_schema = __esm(() => {
1670
1670
  max_retry_attempts_after_initial: exports_external.number().int().min(0).max(2).default(2),
1671
1671
  circuit_open_duration_ms: exports_external.number().int().min(1000).max(1800000).default(60000)
1672
1672
  }).strict();
1673
+ ReviewRoutingConfigSchema = exports_external.object({
1674
+ enforce_receipts: exports_external.boolean().default(true)
1675
+ }).strict();
1676
+ DEFAULT_REVIEW_ROUTING_CONFIG = {
1677
+ enforce_receipts: true
1678
+ };
1673
1679
  LaneLivenessWatchdogConfigSchema = exports_external.object({
1674
1680
  enabled: exports_external.boolean().default(false),
1675
1681
  timeout_ms: exports_external.number().int().min(0).max(86400000).default(1800000),
@@ -1711,6 +1717,7 @@ var init_schema = __esm(() => {
1711
1717
  inject_phase_reminders: exports_external.boolean().default(true).describe("Inject phase reminder directives during execution."),
1712
1718
  hooks: HooksConfigSchema.optional().describe("Hook subsystem toggles and settings."),
1713
1719
  pr_review_resilience: PrReviewResilienceConfigSchema.optional().describe("PR review base-wave staged canary/fanout resilience settings."),
1720
+ review_routing: ReviewRoutingConfigSchema.optional().describe("Semantic review routing receipt enforcement for Stage B (default on; set enforce_receipts=false only as a one-release rollback)."),
1714
1721
  lane_liveness_watchdog: LaneLivenessWatchdogConfigSchema.optional().describe("Lane liveness watchdog: execution deadline and stall escalation for PR workflow lanes."),
1715
1722
  dispatch_protection: DispatchProtectionConfigSchema.optional().describe("Dispatch protection: action-local spawn-failure circuit breaker and token-bucket rate limiting for native task delegations."),
1716
1723
  pr_review_legacy_transcript_compatibility: exports_external.boolean().optional().describe("Deprecated migration-only opt-in for transcript-row PR-review base and micro discovery lanes."),
@@ -1943,4 +1950,4 @@ var init_schema = __esm(() => {
1943
1950
  });
1944
1951
  });
1945
1952
 
1946
- export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, init_context_window, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
1953
+ export { init_package, package_default, DEFAULT_MODEL_CONTEXT_TOKENS, init_context_window, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_SECTION_SCHEMAS, GateConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GATE_CONFIG_READERS, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, RetentionConfigSchema, ReviewPassesConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutoReviewConfigSchema, resolveAutoReviewConfig, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, GitConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, OtlpExportConfigSchema, ObservabilityConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, HarnessEvolutionConfigSchema, DEFAULT_HARNESS_EVOLUTION_CONFIG, SkillImproverConfigSchema, SkillsConfigSchema, SkillOptConfigSchema, DEFAULT_SKILL_OPT_CONFIG, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, DEFAULT_PR_REVIEW_RESILIENCE_CONFIG, PrReviewResilienceConfigSchema, ReviewRoutingConfigSchema, DEFAULT_REVIEW_ROUTING_CONFIG, LaneLivenessWatchdogConfigSchema, DispatchProtectionConfigSchema, DEFAULT_PR_REVIEW_LEGACY_TRANSCRIPT_COMPATIBILITY, PluginConfigSchema, init_schema };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-gwz9p53s.js";
5
+ } from "./index-0c7y177k.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -44,7 +44,7 @@ import {
44
44
  loadPluginConfigWithMeta,
45
45
  loadPluginConfigWithMetaAsync,
46
46
  resetConfigAdvisoryDedup
47
- } from "./index-53c0ajk4.js";
47
+ } from "./index-ddz0a0ew.js";
48
48
  import"./index-0mhftbpp.js";
49
49
  import"./index-a1w58b47.js";
50
50
  import {
@@ -65,12 +65,13 @@ import {
65
65
  PluginConfigSchema,
66
66
  PricingConfigSchema,
67
67
  RepoGraphConfigSchema,
68
+ ReviewRoutingConfigSchema,
68
69
  SkillPropagationConfigSchema,
69
70
  SwarmConfigSchema,
70
71
  TurboConfigSchema,
71
72
  WorktreeIsolationConfigSchema,
72
73
  resolveAutoReviewConfig
73
- } from "./index-90qbc4rp.js";
74
+ } from "./index-kyakvkpk.js";
74
75
  import {
75
76
  ALL_AGENT_NAMES,
76
77
  ALL_SUBAGENT_NAMES,
@@ -113,6 +114,7 @@ export {
113
114
  SpecRequirementSchema,
114
115
  SpecDeltaSchema,
115
116
  SkillPropagationConfigSchema,
117
+ ReviewRoutingConfigSchema,
116
118
  ReviewEvidenceSchema,
117
119
  RepoGraphConfigSchema,
118
120
  QA_AGENTS,
@@ -3,10 +3,10 @@ import {
3
3
  pseudonymousRef,
4
4
  resolveLineageSalt,
5
5
  telemetry
6
- } from "./index-jmn35na4.js";
6
+ } from "./index-5prgmf00.js";
7
7
  import {
8
8
  atomicWriteSwarmFile
9
- } from "./index-bsnpv4xd.js";
9
+ } from "./index-8tn4yx8b.js";
10
10
  import {
11
11
  canonicalRootKeyFresh
12
12
  } from "./index-1xnse449.js";
@@ -12,7 +12,7 @@ import {
12
12
  PluginConfigSchema,
13
13
  init_schema,
14
14
  stripKnownSwarmPrefix
15
- } from "./index-90qbc4rp.js";
15
+ } from "./index-kyakvkpk.js";
16
16
  import {
17
17
  ALL_AGENT_NAMES,
18
18
  TOOL_NAME_SET,
@@ -1295,6 +1295,24 @@ function validateConfigKey(path2, value) {
1295
1295
  emitObjectTypeMismatch("pr_review_resilience", value, findings);
1296
1296
  break;
1297
1297
  }
1298
+ case "review_routing": {
1299
+ emitObjectTypeMismatch("review_routing", value, findings);
1300
+ if (isPlainObject(value)) {
1301
+ const enforceReceipts = value.enforce_receipts;
1302
+ if (enforceReceipts !== undefined && typeof enforceReceipts !== "boolean") {
1303
+ findings.push({
1304
+ id: "invalid-review_routing-enforce_receipts-type",
1305
+ title: "Invalid review_routing.enforce_receipts type",
1306
+ description: `"review_routing.enforce_receipts" must be a boolean, got ${typeof enforceReceipts}`,
1307
+ severity: "error",
1308
+ path: "review_routing.enforce_receipts",
1309
+ currentValue: enforceReceipts,
1310
+ autoFixable: false
1311
+ });
1312
+ }
1313
+ }
1314
+ break;
1315
+ }
1298
1316
  case "lane_liveness_watchdog": {
1299
1317
  emitObjectTypeMismatch("lane_liveness_watchdog", value, findings);
1300
1318
  break;
@@ -9,7 +9,7 @@ import {
9
9
  readEvaluationRun,
10
10
  saveEvaluationRun,
11
11
  saveTaskSetSnapshot
12
- } from "./index-z35ynvj4.js";
12
+ } from "./index-3yw5h3bt.js";
13
13
  import {
14
14
  canonicalHash,
15
15
  computeCandidateInputContentHash,
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  computePlanStructureHash
4
- } from "./index-18b9snn6.js";
4
+ } from "./index-hkx8tqa4.js";
5
5
  import {
6
6
  appendCoreEventSync
7
- } from "./index-mt8pbzda.js";
7
+ } from "./index-rjjtn1w5.js";
8
8
  import {
9
9
  deleteCoordinationState,
10
10
  derivePlanId,
@@ -13,27 +13,27 @@ import {
13
13
  transitionCoordinationState,
14
14
  transitionCoordinationStateWithinTransaction,
15
15
  withCoordinationTransaction
16
- } from "./index-fnx0jzf7.js";
16
+ } from "./index-2xwavnbg.js";
17
17
  import {
18
18
  getProjectDb
19
- } from "./index-dktpzjy9.js";
19
+ } from "./index-6tbnev6y.js";
20
20
  import {
21
21
  canonicalExistingFilesystemPath,
22
22
  legacyCanonicalExistingFilesystemPath
23
23
  } from "./index-ry16d01s.js";
24
24
  import {
25
25
  assertProjectRoot
26
- } from "./index-kdyvk541.js";
26
+ } from "./index-vsvdh976.js";
27
27
  import {
28
28
  require_proper_lockfile
29
29
  } from "./index-7g4c7s5r.js";
30
30
  import {
31
31
  atomicWriteSwarmFile,
32
32
  atomicWriteSwarmFileSync
33
- } from "./index-bsnpv4xd.js";
33
+ } from "./index-8tn4yx8b.js";
34
34
  import {
35
35
  PlanSchema
36
- } from "./index-53c0ajk4.js";
36
+ } from "./index-ddz0a0ew.js";
37
37
  import {
38
38
  init_path_identity,
39
39
  unsafePathTextReason
@@ -11,16 +11,16 @@ import {
11
11
  } from "./index-ae75rja9.js";
12
12
  import {
13
13
  resolveKnowledgeStoreDir
14
- } from "./index-yzwb6ja4.js";
14
+ } from "./index-6v1cz898.js";
15
15
  import {
16
16
  atomicWriteFile
17
- } from "./index-kdyvk541.js";
17
+ } from "./index-vsvdh976.js";
18
18
  import {
19
19
  require_proper_lockfile
20
20
  } from "./index-7g4c7s5r.js";
21
21
  import {
22
22
  readCachedParsedFile
23
- } from "./index-bsnpv4xd.js";
23
+ } from "./index-8tn4yx8b.js";
24
24
  import {
25
25
  init_knowledge_types,
26
26
  isActiveStatus
@@ -739,7 +739,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
739
739
  const {
740
740
  readAuthoritativeKnowledgeCounterRollups,
741
741
  effectiveRetrievalOutcomes
742
- } = await import("./knowledge-events-dx9mjgqb.js");
742
+ } = await import("./knowledge-events-v4hq7wr9.js");
743
743
  const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
744
744
  const flagIds = new Set;
745
745
  for (const e of atFloor) {
@@ -806,11 +806,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
806
806
  });
807
807
  }
808
808
  if (action === "quarantine" && toQuarantine.length > 0) {
809
- const { quarantineEntry } = await import("./knowledge-validator-h49dkw2z.js");
810
- const { KnowledgeConfigSchema } = await import("./schema-70c0yw8p.js");
809
+ const { quarantineEntry } = await import("./knowledge-validator-9wj31ym5.js");
810
+ const { KnowledgeConfigSchema } = await import("./schema-x2nb18fg.js");
811
811
  let config;
812
812
  try {
813
- const { loadPluginConfigWithMeta } = await import("./index-r8g2meas.js");
813
+ const { loadPluginConfigWithMeta } = await import("./index-m8c44754.js");
814
814
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
815
815
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
816
816
  } catch {
@@ -5,18 +5,18 @@ import {
5
5
  import {
6
6
  effectiveRetrievalOutcomes,
7
7
  readAuthoritativeKnowledgeCounterRollups
8
- } from "./index-pynk60z5.js";
8
+ } from "./index-9gpf4tt4.js";
9
9
  import {
10
10
  ALLOWED_SKILL_PATH_PREFIXES,
11
11
  validateSkillPath
12
- } from "./index-cm0339fe.js";
12
+ } from "./index-s6wb6sjk.js";
13
13
  import {
14
14
  computeOutcomeSignal,
15
15
  readKnowledge,
16
16
  resolveHiveKnowledgePath,
17
17
  resolveSwarmKnowledgePath,
18
18
  transactKnowledge
19
- } from "./index-j0vvq8se.js";
19
+ } from "./index-py58gern.js";
20
20
  import {
21
21
  appendCappedJsonl,
22
22
  resolveRetentionCap
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  atomicWriteFileAnyRoot,
26
26
  atomicWriteSwarmFile
27
- } from "./index-bsnpv4xd.js";
27
+ } from "./index-8tn4yx8b.js";
28
28
  import {
29
29
  canonicalRootKeyFresh
30
30
  } from "./index-1xnse449.js";
@@ -4,7 +4,7 @@ import {
4
4
  readShellAuditTail,
5
5
  redactPath,
6
6
  redactShellCommand
7
- } from "./index-62pcs7jg.js";
7
+ } from "./index-bf6w27sb.js";
8
8
 
9
9
  // src/services/guardrail-log-service.ts
10
10
  var BLOCK_TYPES = new Set([
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  observeStoreHealth
4
- } from "./index-43dmpa9w.js";
4
+ } from "./index-mjtja1wq.js";
5
5
  import {
6
6
  telemetry
7
- } from "./index-jmn35na4.js";
7
+ } from "./index-5prgmf00.js";
8
8
  import {
9
9
  init_logger,
10
10
  warn
@@ -152,7 +152,7 @@ var _internals = {
152
152
  limits: CORE_EVENT_LIMITS,
153
153
  emitHealth: emitCoreEventsHealth
154
154
  };
155
- function eventsFilePath(directory) {
155
+ function coreEventsFilePath(directory) {
156
156
  return path.join(directory, ".swarm", "events.jsonl");
157
157
  }
158
158
  function lockFilePath(directory) {
@@ -354,7 +354,7 @@ function atomicReplace(directory, content) {
354
354
  continue;
355
355
  JSON.parse(line);
356
356
  }
357
- const finalPath = eventsFilePath(directory);
357
+ const finalPath = coreEventsFilePath(directory);
358
358
  const tmpPath = tmpPathFor(finalPath);
359
359
  try {
360
360
  if (_internals.existsSync(tmpPath)) {
@@ -469,7 +469,7 @@ function warnThrottled(message) {
469
469
  warn(`core-events: ${message}`);
470
470
  }
471
471
  function readStoreFull(directory) {
472
- const filePath = eventsFilePath(directory);
472
+ const filePath = coreEventsFilePath(directory);
473
473
  if (!_internals.existsSync(filePath)) {
474
474
  return { manifest: null, lines: [], corruptLines: 0 };
475
475
  }
@@ -512,7 +512,7 @@ function coverageFor(fileExists, lineCount, truncated) {
512
512
  return truncated ? "truncated" : "complete";
513
513
  }
514
514
  function readCoreEvents(directory) {
515
- const filePath = eventsFilePath(directory);
515
+ const filePath = coreEventsFilePath(directory);
516
516
  if (!_internals.existsSync(filePath)) {
517
517
  return { text: "", truncated: false, coverage: "empty" };
518
518
  }
@@ -538,7 +538,7 @@ function readCoreEvents(directory) {
538
538
  return { text, truncated, coverage };
539
539
  }
540
540
  function getCoreEventCoverage(directory) {
541
- const filePath = eventsFilePath(directory);
541
+ const filePath = coreEventsFilePath(directory);
542
542
  if (!_internals.existsSync(filePath))
543
543
  return "empty";
544
544
  const size = fileSizeOrZero(filePath);
@@ -556,7 +556,7 @@ function appendCoreEventSync(directory, event, options) {
556
556
  if (lineBytes - 1 > _internals.limits.maxLineBytes) {
557
557
  throw new Error(CORE_EVENT_LINE_TOO_LARGE);
558
558
  }
559
- const filePath = eventsFilePath(directory);
559
+ const filePath = coreEventsFilePath(directory);
560
560
  const swarmDir = path.join(directory, ".swarm");
561
561
  if (options?.ensureSwarmDir === false) {
562
562
  if (!_internals.existsSync(swarmDir)) {
@@ -614,7 +614,7 @@ function appendCoreEventsSync(directory, events, options) {
614
614
  throw new Error(CORE_EVENT_LINE_TOO_LARGE);
615
615
  }
616
616
  }
617
- const filePath = eventsFilePath(directory);
617
+ const filePath = coreEventsFilePath(directory);
618
618
  const swarmDir = path.join(directory, ".swarm");
619
619
  if (options?.ensureSwarmDir === false) {
620
620
  if (!_internals.existsSync(swarmDir)) {
@@ -706,7 +706,7 @@ function hasTaskRepairAuditEvent(directory, taskId, transitionId) {
706
706
  return hasAuthorityEvent(directory, `repair|${taskId}|${transitionId}`, (e) => e.type === AUTHORITY_REPAIR && e.taskId === taskId && e.transitionId === transitionId);
707
707
  }
708
708
  function foldPass(directory, trigger, forceFull, preloadedAuthorityState) {
709
- const filePath = eventsFilePath(directory);
709
+ const filePath = coreEventsFilePath(directory);
710
710
  if (!_internals.existsSync(filePath))
711
711
  return;
712
712
  const view = readStoreFull(directory);
@@ -819,7 +819,7 @@ function foldPass(directory, trigger, forceFull, preloadedAuthorityState) {
819
819
  }
820
820
  function runMaintenance(directory) {
821
821
  try {
822
- const filePath = eventsFilePath(directory);
822
+ const filePath = coreEventsFilePath(directory);
823
823
  if (!_internals.existsSync(filePath))
824
824
  return;
825
825
  const drainThreshold = _internals.limits.activeMaxBytes + _internals.limits.headerMaxBytes + 2048;
@@ -844,7 +844,7 @@ function runMaintenance(directory) {
844
844
  }
845
845
  function finalizeCoreEventsForClose(directory) {
846
846
  try {
847
- const filePath = eventsFilePath(directory);
847
+ const filePath = coreEventsFilePath(directory);
848
848
  if (!_internals.existsSync(filePath))
849
849
  return;
850
850
  withCoreEventStoreLock(directory, () => {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-m51cmzxt.js";
4
+ } from "./index-cw1nbtvh.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,13 +9,13 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-j0vvq8se.js";
12
+ } from "./index-py58gern.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
- } from "./index-yzwb6ja4.js";
15
+ } from "./index-6v1cz898.js";
16
16
  import {
17
17
  atomicWriteFile
18
- } from "./index-kdyvk541.js";
18
+ } from "./index-vsvdh976.js";
19
19
  import {
20
20
  require_proper_lockfile
21
21
  } from "./index-7g4c7s5r.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-evf5r7bk.js";
4
+ } from "./index-czhbsgdh.js";
5
5
  import {
6
6
  bunWrite
7
7
  } from "./index-2s7dvzff.js";
@@ -18,21 +18,21 @@ import {
18
18
  releaseCoordinationLease,
19
19
  transitionCoordinationState,
20
20
  withCoordinationTransaction
21
- } from "./index-fnx0jzf7.js";
21
+ } from "./index-2xwavnbg.js";
22
22
  import {
23
23
  getProjectDb,
24
24
  projectDbExists
25
- } from "./index-dktpzjy9.js";
25
+ } from "./index-6tbnev6y.js";
26
26
  import {
27
27
  observeDelegationLedgerPressure
28
- } from "./index-43dmpa9w.js";
28
+ } from "./index-mjtja1wq.js";
29
29
  import {
30
30
  EvidenceLockTimeoutError,
31
31
  withEvidenceLock
32
- } from "./index-kdyvk541.js";
32
+ } from "./index-vsvdh976.js";
33
33
  import {
34
34
  telemetry
35
- } from "./index-jmn35na4.js";
35
+ } from "./index-5prgmf00.js";
36
36
  import {
37
37
  canonicalRootKeyFresh,
38
38
  sameProjectRoot
@@ -829,6 +829,9 @@ var PrReviewFindingSchema = exports_external.object({
829
829
  next_action: exports_external.enum(PR_REVIEW_FINDING_ACTIONS),
830
830
  severity: exports_external.enum(PR_REVIEW_SEVERITIES).optional(),
831
831
  category: exports_external.string().trim().min(1).max(128).optional(),
832
+ confidence: exports_external.enum(["LOW", "MEDIUM", "HIGH"]).optional(),
833
+ provenance: exports_external.array(exports_external.string().trim().min(1).max(256)).max(16).optional(),
834
+ critic_status: exports_external.enum(["UPHELD", "DOWNGRADED", "DISPROVED", "NEEDS_MORE_EVIDENCE"]).optional(),
832
835
  risk_impact: exports_external.enum(PR_REVIEW_RISK_IMPACTS).optional(),
833
836
  risk_tags: exports_external.array(exports_external.enum(PR_REVIEW_RISK_TAGS)).max(PR_REVIEW_RISK_TAGS.length).optional()
834
837
  }).strict().superRefine((value, ctx) => {
@@ -4651,7 +4654,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
4651
4654
  const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
4652
4655
  if (candidates.length === 0)
4653
4656
  return 0;
4654
- const { transferCoderSettlementToBackground } = await import("./coder-settlement-kxxmd9jt.js");
4657
+ const { transferCoderSettlementToBackground } = await import("./coder-settlement-pwct8te4.js");
4655
4658
  let transferred = 0;
4656
4659
  for (const record of candidates) {
4657
4660
  try {
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  autoCommitDirty,
4
4
  cleanUntrackedFiles
5
- } from "./index-gwtb07gc.js";
5
+ } from "./index-e4g3487s.js";
6
6
  import {
7
7
  validateSwarmPath
8
- } from "./index-evf5r7bk.js";
8
+ } from "./index-czhbsgdh.js";
9
9
  import {
10
10
  bunSpawn,
11
11
  classifySpawnFailure
@@ -15,10 +15,10 @@ import {
15
15
  atomicWriteFile,
16
16
  taskEvidencePath,
17
17
  withTaskEvidenceLock
18
- } from "./index-kdyvk541.js";
18
+ } from "./index-vsvdh976.js";
19
19
  import {
20
20
  telemetry
21
- } from "./index-jmn35na4.js";
21
+ } from "./index-5prgmf00.js";
22
22
  import {
23
23
  init_git_executable,
24
24
  resolveGitExecutable
@@ -61,6 +61,16 @@ var TaskGateRequirementsReceiptSchema = exports_external.object({
61
61
  sourceEvent: exports_external.string().min(1).max(120),
62
62
  sourceTransitionId: exports_external.string().min(1).max(200).nullable(),
63
63
  recordedAt: exports_external.string().min(1).max(128),
64
+ routeBinding: exports_external.object({
65
+ role: exports_external.enum(["reviewer", "test_engineer"]),
66
+ identity: exports_external.string().trim().min(1).max(256),
67
+ sessionId: exports_external.string().trim().min(1).max(256),
68
+ taskId: exports_external.string().trim().min(1).max(120),
69
+ slotId: exports_external.string().trim().min(1).max(256),
70
+ callId: exports_external.string().trim().min(1).max(256),
71
+ childSessionId: exports_external.string().trim().min(1).max(256),
72
+ generation: exports_external.number().int().nonnegative()
73
+ }).strict().optional(),
64
74
  previousChainHash: exports_external.string().regex(/^[a-f0-9]{64}$/).nullable(),
65
75
  chainHash: exports_external.string().regex(/^[a-f0-9]{64}$/)
66
76
  }).strict();
@@ -116,14 +126,42 @@ function sha256(value) {
116
126
  return createHash("sha256").update(value).digest("hex");
117
127
  }
118
128
  function canonicalReceiptPayload(receipt) {
129
+ const routeBinding = receipt.routeBinding ? {
130
+ role: receipt.routeBinding.role,
131
+ identity: receipt.routeBinding.identity,
132
+ sessionId: receipt.routeBinding.sessionId,
133
+ taskId: receipt.routeBinding.taskId,
134
+ slotId: receipt.routeBinding.slotId,
135
+ callId: receipt.routeBinding.callId,
136
+ childSessionId: receipt.routeBinding.childSessionId,
137
+ generation: receipt.routeBinding.generation
138
+ } : undefined;
119
139
  return JSON.stringify({
120
- ...receipt,
121
- requiredGates: [...receipt.requiredGates]
140
+ schemaVersion: receipt.schemaVersion,
141
+ taskId: receipt.taskId,
142
+ generation: receipt.generation,
143
+ normalizedRole: receipt.normalizedRole,
144
+ testEngineerExempt: receipt.testEngineerExempt,
145
+ requiredGates: [...receipt.requiredGates],
146
+ sourceEvent: receipt.sourceEvent,
147
+ sourceTransitionId: receipt.sourceTransitionId,
148
+ recordedAt: receipt.recordedAt,
149
+ ...routeBinding ? { routeBinding } : {},
150
+ previousChainHash: receipt.previousChainHash
122
151
  });
123
152
  }
124
153
  function computeChainHash(receipt) {
125
154
  return sha256(canonicalReceiptPayload(receipt));
126
155
  }
156
+ function routeBindingFromEvent(event) {
157
+ if (event.type !== "stage_b_completed" || !event.routeBinding)
158
+ return;
159
+ const binding = event.routeBinding;
160
+ if (binding.role !== event.gate || !binding.sessionId || !binding.taskId || !binding.slotId || !binding.callId || !binding.childSessionId || typeof binding.generation !== "number") {
161
+ return;
162
+ }
163
+ return binding;
164
+ }
127
165
  function readBoundedTextFile(filePath) {
128
166
  let pathStat;
129
167
  try {
@@ -164,7 +202,7 @@ async function readTaskGateRequirementsReceipts(directory, taskId) {
164
202
  if (!line.trim())
165
203
  continue;
166
204
  const parsed = TaskGateRequirementsReceiptSchema.parse(JSON.parse(line));
167
- if (parsed.taskId !== taskId) {
205
+ if (parsed.taskId !== taskId || parsed.routeBinding !== undefined && parsed.routeBinding.taskId !== taskId) {
168
206
  throw new Error(`TASK_GATE_REQUIREMENTS_IDENTITY_MISMATCH: expected ${taskId}, found ${parsed.taskId}`);
169
207
  }
170
208
  const { chainHash, ...withoutChainHash } = parsed;
@@ -219,8 +257,13 @@ function shouldAppendReceipt(current, next, role) {
219
257
  }
220
258
  async function appendTaskGateRequirementsReceiptIfNeeded(directory, taskId, current, next, event) {
221
259
  const role = deriveReceiptRole(event);
222
- if (!role || !shouldAppendReceipt(current, next, role))
260
+ const routeBinding = routeBindingFromEvent(event);
261
+ if (routeBinding && routeBinding.taskId !== taskId) {
262
+ throw new Error(`TASK_GATE_REQUIREMENTS_ROUTE_IDENTITY_MISMATCH: expected ${taskId}, found ${routeBinding.taskId}`);
263
+ }
264
+ if (!role || !shouldAppendReceipt(current, next, role) && !routeBinding) {
223
265
  return;
266
+ }
224
267
  const filePath = safeTaskGateRequirementsReceiptPath(directory, taskId, true);
225
268
  const receipts = await readTaskGateRequirementsReceipts(directory, taskId);
226
269
  const latest = receipts.at(-1);
@@ -234,13 +277,14 @@ async function appendTaskGateRequirementsReceiptIfNeeded(directory, taskId, curr
234
277
  sourceEvent: event.type,
235
278
  sourceTransitionId: event.transitionId ?? null,
236
279
  recordedAt: new Date().toISOString(),
237
- previousChainHash: latest?.chainHash ?? null
280
+ previousChainHash: latest?.chainHash ?? null,
281
+ ...routeBinding ? { routeBinding } : {}
238
282
  };
239
283
  const receipt = {
240
284
  ...baseReceipt,
241
285
  chainHash: computeChainHash(baseReceipt)
242
286
  };
243
- if (latest && latest.generation === receipt.generation && latest.normalizedRole === receipt.normalizedRole && latest.testEngineerExempt === receipt.testEngineerExempt && JSON.stringify(latest.requiredGates) === JSON.stringify(receipt.requiredGates) && latest.sourceTransitionId === receipt.sourceTransitionId) {
287
+ if (latest && latest.generation === receipt.generation && latest.normalizedRole === receipt.normalizedRole && latest.testEngineerExempt === receipt.testEngineerExempt && JSON.stringify(latest.requiredGates) === JSON.stringify(receipt.requiredGates) && latest.sourceTransitionId === receipt.sourceTransitionId && JSON.stringify(latest.routeBinding ?? null) === JSON.stringify(receipt.routeBinding ?? null)) {
244
288
  return;
245
289
  }
246
290
  const lines = [...receipts, receipt].map((entry) => JSON.stringify(entry));
@@ -1954,6 +1998,15 @@ function reduceTaskWorkflowSnapshot(current, event, context) {
1954
1998
  if (current.state !== "pre_check_passed" && current.state !== "reviewer_run" && current.state !== "tests_run") {
1955
1999
  throw new Error(`TASK_WORKFLOW_STAGE_A_REQUIRED: cannot record ${event.gate} from ${current.state}`);
1956
2000
  }
2001
+ if (event.routeComplete === false) {
2002
+ return {
2003
+ ...base,
2004
+ state: event.gate === "reviewer" || current.state === "reviewer_run" ? "reviewer_run" : current.state
2005
+ };
2006
+ }
2007
+ if (event.routeComplete === true) {
2008
+ return { ...base, state: "tests_run" };
2009
+ }
1957
2010
  return {
1958
2011
  ...base,
1959
2012
  state: hasAllRequiredGatesPassed(context.requiredGates, context.gates) ? "tests_run" : "reviewer_run"
@@ -2182,6 +2235,8 @@ async function recordGateEvidence(directory, taskId, gate, sessionId, turbo, opt
2182
2235
  type: "stage_b_completed",
2183
2236
  gate,
2184
2237
  sessionId,
2238
+ routeBinding: options.routeBinding,
2239
+ routeComplete: options.routeComplete,
2185
2240
  turbo,
2186
2241
  ensureDefaultStageB: options.ensureDefaultStageB,
2187
2242
  expectedGeneration: options.expectedGeneration,