@integrity-labs/agt-cli 0.27.7-test.6 → 0.27.8-test.10

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.
@@ -1529,8 +1529,8 @@ var charter_frontmatter_v1_default = {
1529
1529
  },
1530
1530
  sender_policy: {
1531
1531
  type: "string",
1532
- enum: ["all", "agents_only", "team_agents_only"],
1533
- description: "Restricts which senders this agent processes. 'all' (default): anyone. 'agents_only': only Augmented-labelled agents. 'team_agents_only': only same-team Augmented agents. Enforced via message metadata labels in Slack and activity entity labels in Teams."
1532
+ enum: ["all", "agents_only", "team_agents_only", "manager_only"],
1533
+ description: "Restricts which senders this agent processes. 'all' (default): anyone. 'agents_only': only Augmented-labelled agents. 'team_agents_only': only same-team Augmented agents. 'manager_only' (ENG-5842): only the agent's reports_to_person OR same-team Augmented agents \u2014 narrows the human axis to one principal while keeping cross-agent coordination working. Enforced via message metadata labels (Slack/Teams) and principal-id env vars resolved at provision time."
1534
1534
  }
1535
1535
  },
1536
1536
  additionalProperties: false
@@ -2416,13 +2416,12 @@ function runChannelRules(charter, orgPolicy) {
2416
2416
  }
2417
2417
  if (orgPolicy?.sender_policy) {
2418
2418
  const orgMode = orgPolicy.sender_policy.mode;
2419
- const agentMode = channels.sender_policy ?? "all";
2420
- const rank = {
2421
- all: 0,
2422
- agents_only: 1,
2423
- team_agents_only: 2
2424
- };
2425
- if (!(agentMode in rank) || !(orgMode in rank)) {
2419
+ if (channels.sender_policy === void 0) {
2420
+ return diagnostics;
2421
+ }
2422
+ const agentMode = channels.sender_policy;
2423
+ const ranks = senderPolicyRanks();
2424
+ if (!(agentMode in ranks) || !(orgMode in ranks)) {
2426
2425
  diagnostics.push({
2427
2426
  file: "CHARTER.md",
2428
2427
  code: "CHARTER.CHANNELS.SENDER_POLICY_CONFLICT",
@@ -2430,18 +2429,32 @@ function runChannelRules(charter, orgPolicy) {
2430
2429
  severity: "error",
2431
2430
  message: `Invalid sender_policy mode (agent="${agentMode}", org="${orgMode}")`
2432
2431
  });
2433
- } else if (rank[agentMode] < rank[orgMode]) {
2434
- diagnostics.push({
2435
- file: "CHARTER.md",
2436
- code: "CHARTER.CHANNELS.SENDER_POLICY_CONFLICT",
2437
- path: "channels.sender_policy",
2438
- severity: "error",
2439
- message: `Agent sender_policy "${agentMode}" is less restrictive than the org policy "${orgMode}"`
2440
- });
2432
+ } else {
2433
+ const a = ranks[agentMode];
2434
+ const o = ranks[orgMode];
2435
+ if (a.humanRank < o.humanRank || a.agentRank < o.agentRank) {
2436
+ diagnostics.push({
2437
+ file: "CHARTER.md",
2438
+ code: "CHARTER.CHANNELS.SENDER_POLICY_CONFLICT",
2439
+ path: "channels.sender_policy",
2440
+ severity: "error",
2441
+ message: `Agent sender_policy "${agentMode}" is less restrictive than the org policy "${orgMode}"`
2442
+ });
2443
+ }
2441
2444
  }
2442
2445
  }
2443
2446
  return diagnostics;
2444
2447
  }
2448
+ function senderPolicyRanks() {
2449
+ return {
2450
+ all: { humanRank: 0, agentRank: 0 },
2451
+ agents_only: { humanRank: 1, agentRank: 0 },
2452
+ team_agents_only: { humanRank: 1, agentRank: 1 },
2453
+ // manager_only: stricter than team_agents_only on humans (only the
2454
+ // principal), same as team_agents_only on agents (same-team allowed).
2455
+ manager_only: { humanRank: 2, agentRank: 1 }
2456
+ };
2457
+ }
2445
2458
 
2446
2459
  // ../../packages/core/dist/lint/rules/cross-file.js
2447
2460
  function runCrossFileRules(charter, tools) {
@@ -3933,4 +3946,4 @@ export {
3933
3946
  attributeTranscriptUsageByRun,
3934
3947
  KANBAN_CHECK_COMMAND
3935
3948
  };
3936
- //# sourceMappingURL=chunk-YSBGIXJG.js.map
3949
+ //# sourceMappingURL=chunk-6HFXSNNY.js.map