nexus-agents 2.89.2 → 2.90.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.
package/dist/index.d.ts CHANGED
@@ -28025,10 +28025,17 @@ type SuspiciousSignal = z.infer<typeof SuspiciousSignalSchema>;
28025
28025
  */
28026
28026
  interface GitHubUserMetadata {
28027
28027
  readonly username: string;
28028
- readonly accountAgeDays: number;
28029
- readonly priorContributions: number;
28030
- readonly recentCommentCount: number;
28031
- readonly recentCommentWindowMinutes: number;
28028
+ /**
28029
+ * Account/activity fields are OPTIONAL (#3106). When a field is absent (the
28030
+ * caller couldn't fetch it — e.g. the firewall before Phase 3 wiring), its
28031
+ * signal is SKIPPED rather than fabricated: an unknown value must never be
28032
+ * treated as benign (the old hardcoded `365`/`0`) nor as hostile. Only the
28033
+ * `authorAssociation` + `injectionFlags` signals fire on absent activity data.
28034
+ */
28035
+ readonly accountAgeDays?: number;
28036
+ readonly priorContributions?: number;
28037
+ readonly recentCommentCount?: number;
28038
+ readonly recentCommentWindowMinutes?: number;
28032
28039
  readonly authorAssociation: string;
28033
28040
  readonly injectionFlags: readonly InjectionFlag[];
28034
28041
  }
@@ -28329,6 +28336,14 @@ interface FirewallResult {
28329
28336
  readonly sanitized: SanitizedInput;
28330
28337
  readonly trust: ClassifyResult;
28331
28338
  readonly reputation?: ReputationAssessment;
28339
+ /**
28340
+ * The tier consumers should ENFORCE on (#3106): the classifier tier
28341
+ * reconciled with the reputation assessment (demotion-only; Tier-1/allowlist
28342
+ * wins; equals `trust.trustTier` when reputation is absent). Previously the
28343
+ * reputation tier was computed but dropped — `trust.trustTier` alone left
28344
+ * reputation unenforced.
28345
+ */
28346
+ readonly effectiveTrustTier: TrustTier;
28332
28347
  readonly atl: string;
28333
28348
  readonly auditEvents: readonly {
28334
28349
  readonly id: string;
package/dist/index.js CHANGED
@@ -519,7 +519,7 @@ import {
519
519
  validateWorkflow,
520
520
  validateWorkflowDependencies,
521
521
  withLogging
522
- } from "./chunk-44XYCZCU.js";
522
+ } from "./chunk-EUR32RSL.js";
523
523
  import {
524
524
  getTokenEnvVars,
525
525
  hasToken,
@@ -688,12 +688,13 @@ import {
688
688
  isMutatingAction,
689
689
  isReadOnlyAction,
690
690
  mapAuthorAssociation,
691
+ reconcileTrustTier,
691
692
  requiresCitation,
692
693
  requiresCorroboration,
693
694
  sanitizeInput,
694
695
  validateAgentAction,
695
696
  validateCorroboration
696
- } from "./chunk-IOXR6W24.js";
697
+ } from "./chunk-L3S7HOAS.js";
697
698
  import {
698
699
  GitHubProvider,
699
700
  ScmError
@@ -737,7 +738,7 @@ import {
737
738
  getKnownNexusVarNames,
738
739
  startStdioServer,
739
740
  validateNexusEnv
740
- } from "./chunk-5X7GAOVZ.js";
741
+ } from "./chunk-IBRZK662.js";
741
742
  import {
742
743
  AvailabilityCache,
743
744
  filterAvailableModels,
@@ -4183,12 +4184,14 @@ var HostileInputFirewall = class {
4183
4184
  const sanitized = this.runSanitization(meta);
4184
4185
  const trust = this.runClassification(meta, sanitized);
4185
4186
  const reputation = this.runReputation(meta, sanitized);
4186
- const atl = this.buildATL(meta, trust, sanitized, reputation);
4187
+ const effectiveTrustTier = reconcileTrustTier(trust.trustTier, reputation);
4188
+ const atl = this.buildATL(meta, effectiveTrustTier, sanitized, reputation);
4187
4189
  const auditEvents = this.auditTrail.query().map((e) => ({ id: e.id, type: e.type }));
4188
4190
  return ok({
4189
4191
  sanitized,
4190
4192
  trust,
4191
4193
  ...reputation !== void 0 ? { reputation } : {},
4194
+ effectiveTrustTier,
4192
4195
  atl,
4193
4196
  auditEvents,
4194
4197
  durationMs: Date.now() - start
@@ -4266,10 +4269,6 @@ var HostileInputFirewall = class {
4266
4269
  if (!this.stages.reputationAssessment) return void 0;
4267
4270
  const metadata = {
4268
4271
  username: meta.username,
4269
- accountAgeDays: 365,
4270
- priorContributions: 0,
4271
- recentCommentCount: 0,
4272
- recentCommentWindowMinutes: 60,
4273
4272
  authorAssociation: meta.authorAssociation.toUpperCase(),
4274
4273
  injectionFlags: sanitized.injectionFlags
4275
4274
  };
@@ -4285,9 +4284,9 @@ var HostileInputFirewall = class {
4285
4284
  }
4286
4285
  return result;
4287
4286
  }
4288
- buildATL(meta, trust, sanitized, reputation) {
4287
+ buildATL(meta, effectiveTrustTier, sanitized, reputation) {
4289
4288
  const data = {
4290
- tier: trust.trustTier,
4289
+ tier: effectiveTrustTier,
4291
4290
  source: meta.sourceType,
4292
4291
  user: meta.username,
4293
4292
  sanitized: sanitized.wasModified,