nexus-agents 8.0.1 → 8.1.2

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 (25) hide show
  1. package/dist/{chunk-RB3X45G5.js → chunk-77IF6K22.js} +3 -3
  2. package/dist/{chunk-INNWBLE4.js → chunk-7ERFJWJN.js} +2 -2
  3. package/dist/{chunk-VMMMRHCW.js → chunk-A7HYUZC6.js} +2 -2
  4. package/dist/{chunk-4VZ5GK5B.js → chunk-J4J4RCYI.js} +2 -2
  5. package/dist/{chunk-GHIHBN4J.js → chunk-P7L7DX4C.js} +14 -6
  6. package/dist/chunk-P7L7DX4C.js.map +1 -0
  7. package/dist/chunk-UI3CP2V2.js +7 -0
  8. package/dist/cli.js +7 -7
  9. package/dist/{consensus-vote-6MHOJFIA.js → consensus-vote-YEL2IXAO.js} +4 -4
  10. package/dist/{improvement-review-UV42QAVL.js → improvement-review-YWPSNSIQ.js} +4 -4
  11. package/dist/index.d.ts +131 -2
  12. package/dist/index.js +223 -165
  13. package/dist/index.js.map +1 -1
  14. package/dist/{setup-data-dir-SBZB5KMI.js → setup-data-dir-LDHTNPD3.js} +3 -3
  15. package/package.json +1 -1
  16. package/dist/chunk-227USJYZ.js +0 -7
  17. package/dist/chunk-GHIHBN4J.js.map +0 -1
  18. /package/dist/{chunk-RB3X45G5.js.map → chunk-77IF6K22.js.map} +0 -0
  19. /package/dist/{chunk-INNWBLE4.js.map → chunk-7ERFJWJN.js.map} +0 -0
  20. /package/dist/{chunk-VMMMRHCW.js.map → chunk-A7HYUZC6.js.map} +0 -0
  21. /package/dist/{chunk-4VZ5GK5B.js.map → chunk-J4J4RCYI.js.map} +0 -0
  22. /package/dist/{chunk-227USJYZ.js.map → chunk-UI3CP2V2.js.map} +0 -0
  23. /package/dist/{consensus-vote-6MHOJFIA.js.map → consensus-vote-YEL2IXAO.js.map} +0 -0
  24. /package/dist/{improvement-review-UV42QAVL.js.map → improvement-review-YWPSNSIQ.js.map} +0 -0
  25. /package/dist/{setup-data-dir-SBZB5KMI.js.map → setup-data-dir-LDHTNPD3.js.map} +0 -0
package/dist/index.js CHANGED
@@ -553,7 +553,7 @@ import {
553
553
  withLogging,
554
554
  withRetry,
555
555
  withRetryWrapper
556
- } from "./chunk-GHIHBN4J.js";
556
+ } from "./chunk-P7L7DX4C.js";
557
557
  import {
558
558
  FALLBACK_SCANNER_DATA,
559
559
  buildPlanFromAnalysis,
@@ -574,7 +574,7 @@ import {
574
574
  connectTransport,
575
575
  createServer,
576
576
  startStdioServer
577
- } from "./chunk-RB3X45G5.js";
577
+ } from "./chunk-77IF6K22.js";
578
578
  import {
579
579
  OPENAI_MODELS,
580
580
  OPENAI_MODEL_ALIASES,
@@ -632,7 +632,7 @@ import {
632
632
  generateProposalId,
633
633
  parseAgentPairKey,
634
634
  registerConsensusVoteTool
635
- } from "./chunk-VMMMRHCW.js";
635
+ } from "./chunk-A7HYUZC6.js";
636
636
  import "./chunk-6LDUEA4I.js";
637
637
  import {
638
638
  allOf
@@ -678,12 +678,13 @@ import {
678
678
  TrustTierSchema,
679
679
  assessReputation,
680
680
  reconcileTrustTier,
681
+ resolveEnvMode,
681
682
  sanitizeInput
682
683
  } from "./chunk-HS43MFL4.js";
683
684
  import {
684
685
  ImprovementReviewInputSchema,
685
686
  registerImprovementReviewTool
686
- } from "./chunk-4VZ5GK5B.js";
687
+ } from "./chunk-J4J4RCYI.js";
687
688
  import {
688
689
  AgentPerformanceSchema,
689
690
  ConsensusAlgorithmSchema,
@@ -719,10 +720,10 @@ import {
719
720
  toolSuccess,
720
721
  toolSuccessStructured,
721
722
  validateToolInput
722
- } from "./chunk-INNWBLE4.js";
723
+ } from "./chunk-7ERFJWJN.js";
723
724
  import {
724
725
  VERSION
725
- } from "./chunk-227USJYZ.js";
726
+ } from "./chunk-UI3CP2V2.js";
726
727
  import {
727
728
  AuditTrail,
728
729
  MAX_STRIPPED_ELEMENTS_PER_EVENT,
@@ -2576,17 +2577,32 @@ function getSafetyTaxonomySummary() {
2576
2577
  };
2577
2578
  }
2578
2579
 
2579
- // src/security/firewall/firewall-types.ts
2580
+ // src/security/firewall/firewall-policy-mode.ts
2580
2581
  import { z as z5 } from "zod";
2581
- var FirewallStagesSchema = z5.object({
2582
- sanitization: z5.boolean().default(true),
2583
- trustClassification: z5.boolean().default(true),
2584
- reputationAssessment: z5.boolean().default(false),
2585
- policyEnforcement: z5.boolean().default(true),
2586
- corroboration: z5.boolean().default(false),
2587
- audit: z5.boolean().default(true)
2582
+ var FirewallPolicyModeSchema = z5.enum(["off", "audit", "enforce"]);
2583
+ var DEFAULT_FIREWALL_POLICY_MODE = "off";
2584
+ var FIREWALL_POLICY_ENV_VAR = "NEXUS_FIREWALL_POLICY";
2585
+ function resolveFirewallPolicyMode(env = process.env, logger12) {
2586
+ return resolveEnvMode(
2587
+ env[FIREWALL_POLICY_ENV_VAR],
2588
+ FirewallPolicyModeSchema,
2589
+ DEFAULT_FIREWALL_POLICY_MODE,
2590
+ FIREWALL_POLICY_ENV_VAR,
2591
+ ...logger12 !== void 0 ? [logger12] : []
2592
+ );
2593
+ }
2594
+
2595
+ // src/security/firewall/firewall-types.ts
2596
+ import { z as z6 } from "zod";
2597
+ var FirewallStagesSchema = z6.object({
2598
+ sanitization: z6.boolean().default(true),
2599
+ trustClassification: z6.boolean().default(true),
2600
+ reputationAssessment: z6.boolean().default(false),
2601
+ policyEnforcement: z6.boolean().default(true),
2602
+ corroboration: z6.boolean().default(false),
2603
+ audit: z6.boolean().default(true)
2588
2604
  });
2589
- var FirewallConfigSchema = z5.object({
2605
+ var FirewallConfigSchema = z6.object({
2590
2606
  stages: FirewallStagesSchema.default(() => ({
2591
2607
  sanitization: true,
2592
2608
  trustClassification: true,
@@ -2595,22 +2611,22 @@ var FirewallConfigSchema = z5.object({
2595
2611
  corroboration: false,
2596
2612
  audit: true
2597
2613
  })),
2598
- allowlistedMaintainers: z5.array(z5.string().min(1)).default([]),
2599
- maxInputLength: z5.number().int().positive().default(5e4),
2600
- context: z5.object({
2601
- hasWriteAccess: z5.boolean().default(false),
2602
- hasSecretAccess: z5.boolean().default(false)
2614
+ allowlistedMaintainers: z6.array(z6.string().min(1)).default([]),
2615
+ maxInputLength: z6.number().int().positive().default(5e4),
2616
+ context: z6.object({
2617
+ hasWriteAccess: z6.boolean().default(false),
2618
+ hasSecretAccess: z6.boolean().default(false)
2603
2619
  }).default(() => ({
2604
2620
  hasWriteAccess: false,
2605
2621
  hasSecretAccess: false
2606
2622
  }))
2607
2623
  });
2608
- var ATLDataSchema = z5.object({
2609
- tier: z5.enum(["1", "2", "3", "4"]),
2610
- source: z5.string().min(1),
2611
- user: z5.string().min(1),
2612
- sanitized: z5.boolean(),
2613
- rep: z5.number().min(0).max(1).optional()
2624
+ var ATLDataSchema = z6.object({
2625
+ tier: z6.enum(["1", "2", "3", "4"]),
2626
+ source: z6.string().min(1),
2627
+ user: z6.string().min(1),
2628
+ sanitized: z6.boolean(),
2629
+ rep: z6.number().min(0).max(1).optional()
2614
2630
  });
2615
2631
 
2616
2632
  // src/security/firewall/agent-trust-labels.ts
@@ -2684,6 +2700,8 @@ var HostileInputFirewall = class {
2684
2700
  reputationCache;
2685
2701
  auditTrail;
2686
2702
  context;
2703
+ /** #5382 rollout gate; resolved once at construction, not per call. */
2704
+ policyMode;
2687
2705
  constructor(config) {
2688
2706
  const validated = FirewallConfigSchema.parse({
2689
2707
  stages: config.stages,
@@ -2700,6 +2718,7 @@ var HostileInputFirewall = class {
2700
2718
  config.auditLogger !== void 0 ? createDurableAuditSink(config.auditLogger) : void 0
2701
2719
  );
2702
2720
  this.context = validated.context;
2721
+ this.policyMode = config.policyMode ?? resolveFirewallPolicyMode(config.env ?? process.env);
2703
2722
  }
2704
2723
  /**
2705
2724
  * Processes untrusted input through the firewall pipeline.
@@ -2728,6 +2747,9 @@ var HostileInputFirewall = class {
2728
2747
  rule: ruleOfTwoViolation.rule
2729
2748
  });
2730
2749
  }
2750
+ const blocking = ruleOfTwoViolation?.severity === "block";
2751
+ const refusal = this.refuseIfEnforcing(ruleOfTwoViolation, meta, effectiveTrustTier);
2752
+ if (refusal !== void 0) return err(refusal);
2731
2753
  const auditEvents = this.auditTrail.query().map((e) => ({ id: e.id, type: e.type }));
2732
2754
  return ok({
2733
2755
  sanitized,
@@ -2736,10 +2758,42 @@ var HostileInputFirewall = class {
2736
2758
  effectiveTrustTier,
2737
2759
  atl,
2738
2760
  ...ruleOfTwoViolation !== void 0 ? { ruleOfTwoViolation } : {},
2761
+ policyMode: this.policyMode,
2762
+ // Reached only when we did NOT refuse, so this is "audit mode saw
2763
+ // something enforce would have stopped". Under `off` it stays false: the
2764
+ // signal is already on `ruleOfTwoViolation`, and reporting a would-be
2765
+ // refusal for a mode that has not opted in would overstate the gate.
2766
+ wouldRefuse: blocking && this.policyMode === "audit",
2739
2767
  auditEvents,
2740
2768
  durationMs: Date.now() - start
2741
2769
  });
2742
2770
  }
2771
+ /**
2772
+ * The fail-closed half of the #5382 gate: under `enforce`, a blocking policy
2773
+ * violation refuses the input instead of riding along as a signal on an
2774
+ * `ok()` result that a caller checking only `result.ok` walks straight past.
2775
+ *
2776
+ * This gates the RESPONSE to a violation, never its detection. It cannot
2777
+ * manufacture a refusal where the `policyEnforcement` stage never ran, and it
2778
+ * cannot refuse a non-blocking (`warn`) violation — so `enforce` is not a
2779
+ * kill switch, and an allowlisted maintainer stays served.
2780
+ *
2781
+ * @returns the refusal, or `undefined` when the input passes or the mode has
2782
+ * not opted in.
2783
+ */
2784
+ refuseIfEnforcing(violation, meta, effectiveTrustTier) {
2785
+ if (violation?.severity !== "block" || this.policyMode !== "enforce") return void 0;
2786
+ logger3.warn("Firewall REFUSED input under enforce mode", {
2787
+ user: meta.username,
2788
+ effectiveTrustTier,
2789
+ rule: violation.rule
2790
+ });
2791
+ return {
2792
+ code: "POLICY_REFUSED",
2793
+ message: `Refused by firewall policy: ${violation.rule} \u2014 ${violation.message}`,
2794
+ stage: "policy"
2795
+ };
2796
+ }
2743
2797
  /** Returns the internal audit trail for inspection. */
2744
2798
  getAuditTrail() {
2745
2799
  return this.auditTrail;
@@ -2861,28 +2915,28 @@ function createPassthroughClassification(meta) {
2861
2915
  }
2862
2916
 
2863
2917
  // src/security/firewall/github-adapter.ts
2864
- import { z as z6 } from "zod";
2865
- var GitHubIssueSchema = z6.object({
2866
- type: z6.literal("issue"),
2867
- username: z6.string().min(1),
2868
- authorAssociation: z6.string().min(1),
2869
- title: z6.string().default(""),
2870
- body: z6.string().default("")
2918
+ import { z as z7 } from "zod";
2919
+ var GitHubIssueSchema = z7.object({
2920
+ type: z7.literal("issue"),
2921
+ username: z7.string().min(1),
2922
+ authorAssociation: z7.string().min(1),
2923
+ title: z7.string().default(""),
2924
+ body: z7.string().default("")
2871
2925
  });
2872
- var GitHubCommentSchema = z6.object({
2873
- type: z6.literal("comment"),
2874
- username: z6.string().min(1),
2875
- authorAssociation: z6.string().min(1),
2876
- body: z6.string().default("")
2926
+ var GitHubCommentSchema = z7.object({
2927
+ type: z7.literal("comment"),
2928
+ username: z7.string().min(1),
2929
+ authorAssociation: z7.string().min(1),
2930
+ body: z7.string().default("")
2877
2931
  });
2878
- var GitHubPRSchema = z6.object({
2879
- type: z6.literal("pull_request"),
2880
- username: z6.string().min(1),
2881
- authorAssociation: z6.string().min(1),
2882
- title: z6.string().default(""),
2883
- body: z6.string().default("")
2932
+ var GitHubPRSchema = z7.object({
2933
+ type: z7.literal("pull_request"),
2934
+ username: z7.string().min(1),
2935
+ authorAssociation: z7.string().min(1),
2936
+ title: z7.string().default(""),
2937
+ body: z7.string().default("")
2884
2938
  });
2885
- var GitHubInputSchema = z6.discriminatedUnion("type", [
2939
+ var GitHubInputSchema = z7.discriminatedUnion("type", [
2886
2940
  GitHubIssueSchema,
2887
2941
  GitHubCommentSchema,
2888
2942
  GitHubPRSchema
@@ -2933,7 +2987,7 @@ import { parse, registerDynamicLanguage } from "@ast-grep/napi";
2933
2987
  import goLangRegistration from "@ast-grep/lang-go";
2934
2988
  import pythonLangRegistration from "@ast-grep/lang-python";
2935
2989
  import { parse as parseYaml } from "yaml";
2936
- import { z as z7 } from "zod";
2990
+ import { z as z8 } from "zod";
2937
2991
  var polyglotLangsRegistered = false;
2938
2992
  function ensurePolyglotLangs() {
2939
2993
  if (polyglotLangsRegistered) return;
@@ -2942,12 +2996,12 @@ function ensurePolyglotLangs() {
2942
2996
  }
2943
2997
  var AST_RULE_LANGUAGES = ["python", "go"];
2944
2998
  var AST_RULE_SEVERITIES = ["error", "warning", "info"];
2945
- var RuleFileSchema = z7.object({
2946
- id: z7.string().min(1),
2947
- language: z7.enum(AST_RULE_LANGUAGES),
2948
- severity: z7.enum(AST_RULE_SEVERITIES),
2949
- message: z7.string().min(1),
2950
- rule: z7.record(z7.string(), z7.unknown())
2999
+ var RuleFileSchema = z8.object({
3000
+ id: z8.string().min(1),
3001
+ language: z8.enum(AST_RULE_LANGUAGES),
3002
+ severity: z8.enum(AST_RULE_SEVERITIES),
3003
+ message: z8.string().min(1),
3004
+ rule: z8.record(z8.string(), z8.unknown())
2951
3005
  });
2952
3006
  var MAX_SNIPPET_CHARS = 200;
2953
3007
  var DEFAULT_AST_QA_LIMIT = 200;
@@ -3149,46 +3203,46 @@ async function runAstQaRules(opts) {
3149
3203
  }
3150
3204
 
3151
3205
  // src/orchestration/spec-parser-types.ts
3152
- import { z as z8 } from "zod";
3153
- var IssueReferenceSchema = z8.object({
3206
+ import { z as z9 } from "zod";
3207
+ var IssueReferenceSchema = z9.object({
3154
3208
  /** Issue/PR number */
3155
- number: z8.number().int().positive(),
3209
+ number: z9.number().int().positive(),
3156
3210
  /** Raw text (e.g., "#123") */
3157
- raw: z8.string()
3211
+ raw: z9.string()
3158
3212
  });
3159
- var FileReferenceSchema = z8.object({
3213
+ var FileReferenceSchema = z9.object({
3160
3214
  /** File path (e.g., "src/foo.ts") */
3161
- path: z8.string(),
3215
+ path: z9.string(),
3162
3216
  /** Optional line number */
3163
- line: z8.number().int().positive().optional()
3217
+ line: z9.number().int().positive().optional()
3164
3218
  });
3165
- var TechStackSchema = z8.object({
3219
+ var TechStackSchema = z9.object({
3166
3220
  /** Programming language */
3167
- language: z8.string().optional(),
3221
+ language: z9.string().optional(),
3168
3222
  /** Framework or library */
3169
- framework: z8.string().optional(),
3223
+ framework: z9.string().optional(),
3170
3224
  /** Package manager */
3171
- packageManager: z8.string().optional()
3225
+ packageManager: z9.string().optional()
3172
3226
  });
3173
- var ParsedSpecSchema = z8.object({
3227
+ var ParsedSpecSchema = z9.object({
3174
3228
  /** Spec title (from first H1 or H2 heading) */
3175
- title: z8.string().min(1),
3229
+ title: z9.string().min(1),
3176
3230
  /** Overview/description text */
3177
- overview: z8.string(),
3231
+ overview: z9.string(),
3178
3232
  /** List of requirements */
3179
- requirements: z8.array(z8.string()),
3233
+ requirements: z9.array(z9.string()),
3180
3234
  /** Acceptance criteria (checklist items) */
3181
- acceptanceCriteria: z8.array(z8.string()),
3235
+ acceptanceCriteria: z9.array(z9.string()),
3182
3236
  /** Constraints or limitations */
3183
- constraints: z8.array(z8.string()),
3237
+ constraints: z9.array(z9.string()),
3184
3238
  /** Issue/PR references found in the spec */
3185
- issueReferences: z8.array(IssueReferenceSchema),
3239
+ issueReferences: z9.array(IssueReferenceSchema),
3186
3240
  /** File path references found in the spec */
3187
- fileReferences: z8.array(FileReferenceSchema),
3241
+ fileReferences: z9.array(FileReferenceSchema),
3188
3242
  /** Sections that were missing from the spec */
3189
- missingSections: z8.array(z8.string()),
3243
+ missingSections: z9.array(z9.string()),
3190
3244
  /** Raw markdown source */
3191
- rawMarkdown: z8.string(),
3245
+ rawMarkdown: z9.string(),
3192
3246
  /** Inferred technology stack */
3193
3247
  techStack: TechStackSchema.optional()
3194
3248
  });
@@ -3204,136 +3258,136 @@ var KNOWN_SECTIONS = [
3204
3258
  ];
3205
3259
 
3206
3260
  // src/orchestration/spec-decomposer-types.ts
3207
- import { z as z9 } from "zod";
3208
- var SubtaskTypeSchema = z9.enum(["code", "test", "docs", "config", "refactor"]);
3209
- var ComplexityLevelSchema = z9.enum(["simple", "moderate", "complex", "expert"]);
3210
- var SubtaskNodeSchema = z9.object({
3261
+ import { z as z10 } from "zod";
3262
+ var SubtaskTypeSchema = z10.enum(["code", "test", "docs", "config", "refactor"]);
3263
+ var ComplexityLevelSchema = z10.enum(["simple", "moderate", "complex", "expert"]);
3264
+ var SubtaskNodeSchema = z10.object({
3211
3265
  /** Unique identifier for this subtask */
3212
- id: z9.string().min(1),
3266
+ id: z10.string().min(1),
3213
3267
  /** Human-readable description of what this subtask does */
3214
- description: z9.string().min(1),
3268
+ description: z10.string().min(1),
3215
3269
  /** The type of work */
3216
3270
  type: SubtaskTypeSchema,
3217
3271
  /** Estimated complexity */
3218
3272
  complexity: ComplexityLevelSchema,
3219
3273
  /** Required capabilities for the executing agent */
3220
- capabilities: z9.array(z9.string()),
3274
+ capabilities: z10.array(z10.string()),
3221
3275
  /** IDs of subtasks this depends on */
3222
- dependsOn: z9.array(z9.string()),
3276
+ dependsOn: z10.array(z10.string()),
3223
3277
  /** Source requirement text that generated this subtask */
3224
- sourceRequirement: z9.string().optional()
3278
+ sourceRequirement: z10.string().optional()
3225
3279
  });
3226
- var DagEdgeSchema = z9.object({
3280
+ var DagEdgeSchema = z10.object({
3227
3281
  /** Source subtask ID */
3228
- from: z9.string().min(1),
3282
+ from: z10.string().min(1),
3229
3283
  /** Target subtask ID */
3230
- to: z9.string().min(1)
3284
+ to: z10.string().min(1)
3231
3285
  });
3232
- var TaskDagSchema = z9.object({
3286
+ var TaskDagSchema = z10.object({
3233
3287
  /** All subtask nodes */
3234
- nodes: z9.array(SubtaskNodeSchema),
3288
+ nodes: z10.array(SubtaskNodeSchema),
3235
3289
  /** Dependency edges (from must complete before to) */
3236
- edges: z9.array(DagEdgeSchema),
3290
+ edges: z10.array(DagEdgeSchema),
3237
3291
  /** Subtask IDs that can execute in parallel (no dependencies) */
3238
- roots: z9.array(z9.string()),
3292
+ roots: z10.array(z10.string()),
3239
3293
  /** Total estimated complexity across all subtasks */
3240
3294
  totalComplexity: ComplexityLevelSchema,
3241
3295
  /** Source spec title for traceability */
3242
- specTitle: z9.string()
3296
+ specTitle: z10.string()
3243
3297
  });
3244
3298
 
3245
3299
  // src/orchestration/scenario-validator-types.ts
3246
- import { z as z10 } from "zod";
3247
- var CriterionResultSchema = z10.object({
3300
+ import { z as z11 } from "zod";
3301
+ var CriterionResultSchema = z11.object({
3248
3302
  /** The original acceptance criterion text */
3249
- criterion: z10.string(),
3303
+ criterion: z11.string(),
3250
3304
  /** Whether this criterion was satisfied */
3251
- met: z10.boolean(),
3305
+ met: z11.boolean(),
3252
3306
  /** Which result(s) matched this criterion */
3253
- matchedResults: z10.array(z10.string())
3307
+ matchedResults: z11.array(z11.string())
3254
3308
  });
3255
- var ScenarioResultSchema = z10.object({
3309
+ var ScenarioResultSchema = z11.object({
3256
3310
  /** Satisfaction score from 0 (none met) to 1 (all met) */
3257
- satisfaction: z10.number().min(0).max(1),
3311
+ satisfaction: z11.number().min(0).max(1),
3258
3312
  /** Total acceptance criteria count */
3259
- totalCriteria: z10.number().int().nonnegative(),
3313
+ totalCriteria: z11.number().int().nonnegative(),
3260
3314
  /** Number of criteria met */
3261
- metCount: z10.number().int().nonnegative(),
3315
+ metCount: z11.number().int().nonnegative(),
3262
3316
  /** Per-criterion results */
3263
- criteria: z10.array(CriterionResultSchema),
3317
+ criteria: z11.array(CriterionResultSchema),
3264
3318
  /** Whether all criteria are met */
3265
- allMet: z10.boolean()
3319
+ allMet: z11.boolean()
3266
3320
  });
3267
3321
 
3268
3322
  // src/orchestration/parallel-exploration-types.ts
3269
- import { z as z11 } from "zod";
3270
- var ParallelExplorationConfigSchema = z11.object({
3323
+ import { z as z12 } from "zod";
3324
+ var ParallelExplorationConfigSchema = z12.object({
3271
3325
  /** Max CLIs to dispatch to in parallel (default: 3) */
3272
- maxParallelClis: z11.number().int().min(1).max(4).default(3),
3326
+ maxParallelClis: z12.number().int().min(1).max(4).default(3),
3273
3327
  /** Timeout per CLI invocation in ms (default: explorationMs from centralized timeouts). */
3274
- perCliTimeoutMs: z11.number().int().min(1e3).max(3e5).default(PER_CLI_TASK_TIMEOUTS.explorationMs),
3328
+ perCliTimeoutMs: z12.number().int().min(1e3).max(3e5).default(PER_CLI_TASK_TIMEOUTS.explorationMs),
3275
3329
  /** Maximum output chars per CLI response (default: 8000, raised from 4k for exploration depth). */
3276
- maxOutputCharsPerCli: z11.number().int().min(100).max(2e4).default(8e3)
3330
+ maxOutputCharsPerCli: z12.number().int().min(100).max(2e4).default(8e3)
3277
3331
  });
3278
3332
 
3279
3333
  // src/orchestration/triangulated-review-types.ts
3280
- import { z as z12 } from "zod";
3281
- var TriangulatedReviewConfigSchema = z12.object({
3334
+ import { z as z13 } from "zod";
3335
+ var TriangulatedReviewConfigSchema = z13.object({
3282
3336
  /** Max CLIs to dispatch to (default: 3). */
3283
- maxClis: z12.number().int().min(1).max(4).default(3),
3337
+ maxClis: z13.number().int().min(1).max(4).default(3),
3284
3338
  /** Per-CLI timeout in ms (default from config/timeouts.ts, Issue #984). */
3285
- perCliTimeoutMs: z12.number().int().min(PER_CLI_TASK_TIMEOUTS.minMs).max(PER_CLI_TASK_TIMEOUTS.maxMs).default(PER_CLI_TASK_TIMEOUTS.defaultMs),
3339
+ perCliTimeoutMs: z13.number().int().min(PER_CLI_TASK_TIMEOUTS.minMs).max(PER_CLI_TASK_TIMEOUTS.maxMs).default(PER_CLI_TASK_TIMEOUTS.defaultMs),
3286
3340
  /** Max chars per CLI response (default: 8000). */
3287
- maxOutputCharsPerCli: z12.number().int().min(100).max(3e4).default(8e3),
3341
+ maxOutputCharsPerCli: z13.number().int().min(100).max(3e4).default(8e3),
3288
3342
  /** Line proximity for dedup: findings within N lines are considered same (default: 5). */
3289
- lineProximity: z12.number().int().min(0).max(50).default(5)
3343
+ lineProximity: z13.number().int().min(0).max(50).default(5)
3290
3344
  });
3291
3345
 
3292
3346
  // src/orchestration/triangulated-review.ts
3293
3347
  var moduleLogger = createLogger({ component: "triangulated-review" });
3294
3348
 
3295
3349
  // src/orchestration/consensus-plan-types.ts
3296
- import { z as z13 } from "zod";
3297
- var PlanStepSchema = z13.object({
3350
+ import { z as z14 } from "zod";
3351
+ var PlanStepSchema = z14.object({
3298
3352
  /** Step description. */
3299
- description: z13.string(),
3353
+ description: z14.string(),
3300
3354
  /** Estimated complexity: low, medium, high. */
3301
- complexity: z13.enum(["low", "medium", "high"]).default("medium"),
3355
+ complexity: z14.enum(["low", "medium", "high"]).default("medium"),
3302
3356
  /** Dependencies on other step indices. */
3303
- dependencies: z13.array(z13.number().int().min(0)).default([])
3357
+ dependencies: z14.array(z14.number().int().min(0)).default([])
3304
3358
  });
3305
- var PlanRiskSchema = z13.object({
3359
+ var PlanRiskSchema = z14.object({
3306
3360
  /** Risk description. */
3307
- description: z13.string(),
3361
+ description: z14.string(),
3308
3362
  /** Impact level. */
3309
- impact: z13.enum(["low", "medium", "high"]).default("medium"),
3363
+ impact: z14.enum(["low", "medium", "high"]).default("medium"),
3310
3364
  /** Mitigation strategy. */
3311
- mitigation: z13.string().default("")
3365
+ mitigation: z14.string().default("")
3312
3366
  });
3313
- var ConsensusPlanConfigSchema = z13.object({
3367
+ var ConsensusPlanConfigSchema = z14.object({
3314
3368
  /** Max CLIs to dispatch to (default: 3). */
3315
- maxClis: z13.number().int().min(1).max(4).default(3),
3369
+ maxClis: z14.number().int().min(1).max(4).default(3),
3316
3370
  /** Per-CLI timeout in ms (default from config/timeouts.ts, Issue #984). */
3317
- perCliTimeoutMs: z13.number().int().min(PER_CLI_TASK_TIMEOUTS.minMs).max(PER_CLI_TASK_TIMEOUTS.maxMs).default(PER_CLI_TASK_TIMEOUTS.defaultMs),
3371
+ perCliTimeoutMs: z14.number().int().min(PER_CLI_TASK_TIMEOUTS.minMs).max(PER_CLI_TASK_TIMEOUTS.maxMs).default(PER_CLI_TASK_TIMEOUTS.defaultMs),
3318
3372
  /** Max chars per CLI response (default: 8000). */
3319
- maxOutputCharsPerCli: z13.number().int().min(100).max(3e4).default(8e3)
3373
+ maxOutputCharsPerCli: z14.number().int().min(100).max(3e4).default(8e3)
3320
3374
  });
3321
3375
 
3322
3376
  // src/orchestration/consensus-plan.ts
3323
3377
  var moduleLogger2 = createLogger({ component: "consensus-plan" });
3324
3378
 
3325
3379
  // src/agents/observability/orchestration-observer-types.ts
3326
- import { z as z14 } from "zod";
3327
- var AgentStateSchema = z14.enum(["idle", "thinking", "executing", "waiting", "error"]);
3328
- var OrchestrationObserverConfigSchema = z14.object({
3380
+ import { z as z15 } from "zod";
3381
+ var AgentStateSchema = z15.enum(["idle", "thinking", "executing", "waiting", "error"]);
3382
+ var OrchestrationObserverConfigSchema = z15.object({
3329
3383
  /** Maximum routing decisions to retain in history */
3330
- maxRoutingHistory: z14.number().positive().optional().default(100),
3384
+ maxRoutingHistory: z15.number().positive().optional().default(100),
3331
3385
  /** Maximum session metrics to retain */
3332
- maxSessionHistory: z14.number().positive().optional().default(50),
3386
+ maxSessionHistory: z15.number().positive().optional().default(50),
3333
3387
  /** Metrics update interval in ms */
3334
- metricsUpdateIntervalMs: z14.number().positive().optional().default(5e3),
3388
+ metricsUpdateIntervalMs: z15.number().positive().optional().default(5e3),
3335
3389
  /** Enable detailed event logging */
3336
- verboseLogging: z14.boolean().optional().default(false),
3390
+ verboseLogging: z15.boolean().optional().default(false),
3337
3391
  /**
3338
3392
  * Per-model cost rate override, USD per 1,000 tokens (#5180).
3339
3393
  *
@@ -3352,13 +3406,13 @@ var OrchestrationObserverConfigSchema = z14.object({
3352
3406
  * defect this replaces. An operator who wants the old figures can keep their
3353
3407
  * existing scalar config and get byte-identical results.
3354
3408
  */
3355
- tokenCostRates: z14.record(
3356
- z14.string(),
3357
- z14.union([
3358
- z14.number().nonnegative(),
3359
- z14.object({
3360
- input: z14.number().nonnegative(),
3361
- output: z14.number().nonnegative()
3409
+ tokenCostRates: z15.record(
3410
+ z15.string(),
3411
+ z15.union([
3412
+ z15.number().nonnegative(),
3413
+ z15.object({
3414
+ input: z15.number().nonnegative(),
3415
+ output: z15.number().nonnegative()
3362
3416
  })
3363
3417
  ])
3364
3418
  ).optional().default({})
@@ -4583,45 +4637,45 @@ function matchesArtifactFilter(artifact, filter) {
4583
4637
  }
4584
4638
 
4585
4639
  // src/pipeline/trace-schema.ts
4586
- import { z as z15 } from "zod";
4587
- var ExecutionTraceEntrySchema = z15.object({
4640
+ import { z as z16 } from "zod";
4641
+ var ExecutionTraceEntrySchema = z16.object({
4588
4642
  /** Unix timestamp (ms). */
4589
- timestamp: z15.number(),
4643
+ timestamp: z16.number(),
4590
4644
  /** Run identifier (typically TaskContract.id). */
4591
- runId: z15.string().min(1),
4645
+ runId: z16.string().min(1),
4592
4646
  /** Pipeline event type that produced this trace entry. */
4593
- eventType: z15.string().min(1),
4647
+ eventType: z16.string().min(1),
4594
4648
  /** Execution ID for pipeline correlation. */
4595
- executionId: z15.string().optional(),
4649
+ executionId: z16.string().optional(),
4596
4650
  /** Graph node or stage that produced this event. */
4597
- nodeId: z15.string().optional(),
4651
+ nodeId: z16.string().optional(),
4598
4652
  /** Agent that executed this step. */
4599
- agentId: z15.string().optional(),
4653
+ agentId: z16.string().optional(),
4600
4654
  /** Model used for this step. */
4601
- modelId: z15.string().optional(),
4655
+ modelId: z16.string().optional(),
4602
4656
  /** Agent role (e.g., code_expert, security_expert). */
4603
- role: z15.string().optional(),
4657
+ role: z16.string().optional(),
4604
4658
  /** Duration in milliseconds. */
4605
- durationMs: z15.number().optional(),
4659
+ durationMs: z16.number().optional(),
4606
4660
  /** Human-readable model selection reasoning. */
4607
- reasoning: z15.string().optional(),
4661
+ reasoning: z16.string().optional(),
4608
4662
  /** Routing decision path (stage:result pairs). */
4609
- decisionPath: z15.array(z15.string()).optional(),
4663
+ decisionPath: z16.array(z16.string()).optional(),
4610
4664
  /** Error classification. */
4611
- errorTaxonomy: z15.enum(["retriable", "fatal"]).optional(),
4665
+ errorTaxonomy: z16.enum(["retriable", "fatal"]).optional(),
4612
4666
  /** Error message if this is a failure event. */
4613
- error: z15.string().optional(),
4667
+ error: z16.string().optional(),
4614
4668
  /** Wave number (1-based) for wave dispatch events. */
4615
- waveNumber: z15.number().optional(),
4669
+ waveNumber: z16.number().optional(),
4616
4670
  /** Total waves in the dispatch plan. */
4617
- totalWaves: z15.number().optional(),
4671
+ totalWaves: z16.number().optional(),
4618
4672
  /** Number of workers in this wave. */
4619
- workerCount: z15.number().optional()
4673
+ workerCount: z16.number().optional()
4620
4674
  });
4621
4675
 
4622
4676
  // src/security/quality-gate-types.ts
4623
- import { z as z16 } from "zod";
4624
- var PipelineStageSchema = z16.enum([
4677
+ import { z as z17 } from "zod";
4678
+ var PipelineStageSchema = z17.enum([
4625
4679
  "research",
4626
4680
  "plan",
4627
4681
  "vote",
@@ -4630,16 +4684,16 @@ var PipelineStageSchema = z16.enum([
4630
4684
  "qa",
4631
4685
  "ship"
4632
4686
  ]);
4633
- var GateVerdictSchema = z16.enum(["pass", "fail", "skip"]);
4634
- var GateCheckResultSchema = z16.object({
4687
+ var GateVerdictSchema = z17.enum(["pass", "fail", "skip"]);
4688
+ var GateCheckResultSchema = z17.object({
4635
4689
  /** Name of the check (e.g., 'tests_pass', 'lint_clean'). */
4636
- name: z16.string().min(1),
4690
+ name: z17.string().min(1),
4637
4691
  /** Pass/fail/skip verdict. */
4638
4692
  verdict: GateVerdictSchema,
4639
4693
  /** Human-readable details. */
4640
- details: z16.string().max(500),
4694
+ details: z17.string().max(500),
4641
4695
  /** Duration of the check in ms. */
4642
- durationMs: z16.number().nonnegative().optional()
4696
+ durationMs: z17.number().nonnegative().optional()
4643
4697
  });
4644
4698
 
4645
4699
  // src/pipeline/quality-pipeline.ts
@@ -4744,7 +4798,7 @@ function buildVotingInput(plan, config) {
4744
4798
  }
4745
4799
  async function executeSingleVote(plan, config, log) {
4746
4800
  try {
4747
- const { executeVoting } = await import("./consensus-vote-6MHOJFIA.js");
4801
+ const { executeVoting } = await import("./consensus-vote-YEL2IXAO.js");
4748
4802
  const input = buildVotingInput(plan, config);
4749
4803
  const result = await executeVoting(input, log);
4750
4804
  return parseVotingResult(result);
@@ -4906,6 +4960,7 @@ export {
4906
4960
  DEFAULT_EXECUTION_TIME_MS,
4907
4961
  DEFAULT_FEEDBACK_COLLECTOR_CONFIG,
4908
4962
  DEFAULT_FEEDBACK_INTEGRATION_CONFIG,
4963
+ DEFAULT_FIREWALL_POLICY_MODE,
4909
4964
  DEFAULT_FOREST_CONFIG,
4910
4965
  DEFAULT_HIGHER_ORDER_CONFIG,
4911
4966
  DEFAULT_MAX_RETRIES,
@@ -4969,6 +5024,7 @@ export {
4969
5024
  ExplorationEventTypeSchema,
4970
5025
  ExtractSymbolsInputSchema,
4971
5026
  FALLBACK_SCANNER_DATA,
5027
+ FIREWALL_POLICY_ENV_VAR,
4972
5028
  FactoryError,
4973
5029
  FailurePatternSchema,
4974
5030
  FeedbackCollectorConfigSchema,
@@ -4977,6 +5033,7 @@ export {
4977
5033
  FileAuditStorage,
4978
5034
  FileReferenceSchema,
4979
5035
  FindingVoteSchema,
5036
+ FirewallPolicyModeSchema,
4980
5037
  ForestConfigSchema,
4981
5038
  ForestPruningStrategySchema,
4982
5039
  ForestResultSchema,
@@ -5657,6 +5714,7 @@ export {
5657
5714
  resetRegistry,
5658
5715
  resolveExpression,
5659
5716
  resolveFallback,
5717
+ resolveFirewallPolicyMode,
5660
5718
  resolveInput,
5661
5719
  resolvePipelineDeps,
5662
5720
  resolveScannerData,