@integrity-labs/agt-cli 0.28.1079 → 0.28.1080

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.
@@ -24,7 +24,7 @@ import {
24
24
  rotateDailySession,
25
25
  sessionFileExists,
26
26
  todayLocalIso
27
- } from "./chunk-5SASCNYV.js";
27
+ } from "./chunk-7F2UFKYG.js";
28
28
  import {
29
29
  classifyUnanswerablePane,
30
30
  findUsageLimitResetHint,
@@ -6113,4 +6113,4 @@ export {
6113
6113
  stopAllSessionsAndWait,
6114
6114
  getProjectDir
6115
6115
  };
6116
- //# sourceMappingURL=chunk-OGMCA67P.js.map
6116
+ //# sourceMappingURL=chunk-SREQF7XT.js.map
@@ -16,7 +16,7 @@ import {
16
16
  parseEnvFileEntries,
17
17
  parseEnvIntegrations,
18
18
  shellQuote
19
- } from "./chunk-OGMCA67P.js";
19
+ } from "./chunk-SREQF7XT.js";
20
20
  import {
21
21
  BIND_FAILURE_QUARANTINE_THRESHOLD,
22
22
  INTEGRATIONS_SECTION_END,
@@ -79,7 +79,7 @@ import {
79
79
  sessionTranscriptDir,
80
80
  worseConnectivityOutcome,
81
81
  wrapScheduledTaskPrompt
82
- } from "./chunk-5SASCNYV.js";
82
+ } from "./chunk-7F2UFKYG.js";
83
83
  import {
84
84
  classifyUnanswerablePane,
85
85
  isConsumerTermsDialogVisible,
@@ -7122,7 +7122,7 @@ function exchangeFailureKind(err) {
7122
7122
  }
7123
7123
 
7124
7124
  // src/lib/api-client.ts
7125
- var agtCliVersion = true ? "0.28.1079" : "dev";
7125
+ var agtCliVersion = true ? "0.28.1080" : "dev";
7126
7126
  var lastConfigHash = null;
7127
7127
  function setConfigHash(hash) {
7128
7128
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -12095,4 +12095,4 @@ export {
12095
12095
  managerInstallSystemUnitCommand,
12096
12096
  managerUninstallSystemUnitCommand
12097
12097
  };
12098
- //# sourceMappingURL=chunk-TTSW5ZM2.js.map
12098
+ //# sourceMappingURL=chunk-W4NEUOMU.js.map
@@ -266,7 +266,7 @@ async function spawnPairSession(session) {
266
266
  return { ok: true };
267
267
  } catch {
268
268
  }
269
- const { resolveClaudeBinary } = await import("./persistent-session-UZUEF6BV.js");
269
+ const { resolveClaudeBinary } = await import("./persistent-session-HC2M4YIE.js");
270
270
  const claudeBin = resolveClaudeBinary();
271
271
  const pairEnv = {
272
272
  ...process.env,
@@ -734,4 +734,4 @@ export {
734
734
  startClaudePair,
735
735
  submitClaudePairCode
736
736
  };
737
- //# sourceMappingURL=claude-pair-runtime-ZHB5I7E6.js.map
737
+ //# sourceMappingURL=claude-pair-runtime-JCCZH6OO.js.map
@@ -67,7 +67,7 @@ import {
67
67
  safeWriteJsonAtomic,
68
68
  setConfigHash,
69
69
  tripClass
70
- } from "../chunk-TTSW5ZM2.js";
70
+ } from "../chunk-W4NEUOMU.js";
71
71
  import {
72
72
  getProjectDir as getProjectDir2,
73
73
  getReadyTasks,
@@ -154,7 +154,7 @@ import {
154
154
  webFetchBaselineValue,
155
155
  webFetchRestartNeeded,
156
156
  writeEgressAllowlist
157
- } from "../chunk-OGMCA67P.js";
157
+ } from "../chunk-SREQF7XT.js";
158
158
  import {
159
159
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
160
160
  AnchorSessionClient,
@@ -263,7 +263,7 @@ import {
263
263
  subagentActivityAgeSeconds,
264
264
  sumTranscriptUsageInWindow,
265
265
  transcriptActivityAgeSeconds
266
- } from "../chunk-5SASCNYV.js";
266
+ } from "../chunk-7F2UFKYG.js";
267
267
  import {
268
268
  classifyUnanswerablePane,
269
269
  paneRemedy
@@ -14141,7 +14141,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
14141
14141
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
14142
14142
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
14143
14143
  async function channelInboundActivityAgeSecondsFor(codeName) {
14144
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-K5DU6QFZ.js");
14144
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-FU36EGNL.js");
14145
14145
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
14146
14146
  if (newest === null) return null;
14147
14147
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -14899,7 +14899,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
14899
14899
  var lastVersionCheckAt = 0;
14900
14900
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
14901
14901
  var lastResponsivenessProbeAt = 0;
14902
- var agtCliVersion = true ? "0.28.1079" : "dev";
14902
+ var agtCliVersion = true ? "0.28.1080" : "dev";
14903
14903
  function resolveBrewPath(execFileSync3) {
14904
14904
  try {
14905
14905
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -16516,7 +16516,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
16516
16516
  if (codeNames.length === 0) return;
16517
16517
  void (async () => {
16518
16518
  try {
16519
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
16519
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
16520
16520
  await api.post("/host/heartbeat", {
16521
16521
  host_id: hostId,
16522
16522
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -16658,7 +16658,7 @@ async function pollCycleInner() {
16658
16658
  }
16659
16659
  try {
16660
16660
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
16661
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
16661
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
16662
16662
  const diagCodeNames = [...agentState.persistentSessionAgents];
16663
16663
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor) : void 0;
16664
16664
  let tailscaleHostname;
@@ -16866,7 +16866,7 @@ async function pollCycleInner() {
16866
16866
  collectPanelessActivityProbes,
16867
16867
  getResponsivenessIntervalMs,
16868
16868
  occupancyQualificationClassifications
16869
- } = await import("../responsiveness-probe-K5DU6QFZ.js");
16869
+ } = await import("../responsiveness-probe-FU36EGNL.js");
16870
16870
  const probeIntervalMs = getResponsivenessIntervalMs();
16871
16871
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
16872
16872
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -16983,7 +16983,7 @@ async function pollCycleInner() {
16983
16983
  collectResponsivenessProbes,
16984
16984
  livePendingInboundOldestAgeSeconds,
16985
16985
  parkPendingInbound
16986
- } = await import("../responsiveness-probe-K5DU6QFZ.js");
16986
+ } = await import("../responsiveness-probe-FU36EGNL.js");
16987
16987
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
16988
16988
  const wedgeNow = /* @__PURE__ */ new Date();
16989
16989
  const liveAgents = agentState.persistentSessionAgents;
@@ -17269,7 +17269,7 @@ async function pollCycleInner() {
17269
17269
  }
17270
17270
  }
17271
17271
  );
17272
- const { parkPendingInbound } = await import("../responsiveness-probe-K5DU6QFZ.js");
17272
+ const { parkPendingInbound } = await import("../responsiveness-probe-FU36EGNL.js");
17273
17273
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
17274
17274
  paneFatalStreak.delete(codeName);
17275
17275
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -17300,7 +17300,7 @@ async function pollCycleInner() {
17300
17300
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
17301
17301
  bindSourceEscalations
17302
17302
  } = await import("../transcript-mount-health-OHE6IVJV.js");
17303
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-UZUEF6BV.js");
17303
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-HC2M4YIE.js");
17304
17304
  const mountConfig = resolveTranscriptMountConfig();
17305
17305
  const liveAgents = agentState.persistentSessionAgents;
17306
17306
  for (const tracked of [
@@ -17465,7 +17465,7 @@ async function pollCycleInner() {
17465
17465
  }
17466
17466
  try {
17467
17467
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
17468
- const { probeSessionAuth } = await import("../session-auth-dead-47ZVQPUP.js");
17468
+ const { probeSessionAuth } = await import("../session-auth-dead-W6E555FY.js");
17469
17469
  const observations = [];
17470
17470
  const pendingCacheCommits = [];
17471
17471
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -22030,7 +22030,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
22030
22030
  try {
22031
22031
  const freshId = rotateSessionForWedge(codeName);
22032
22032
  consecutiveWedgeCycles.delete(codeName);
22033
- const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-K5DU6QFZ.js");
22033
+ const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-FU36EGNL.js");
22034
22034
  const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
22035
22035
  const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
22036
22036
  const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
@@ -22073,7 +22073,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
22073
22073
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
22074
22074
  void (async () => {
22075
22075
  try {
22076
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
22076
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
22077
22077
  await api.post("/host/heartbeat", {
22078
22078
  host_id: hostId,
22079
22079
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -22124,7 +22124,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
22124
22124
  }
22125
22125
  try {
22126
22126
  const hostId = await getHostId();
22127
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
22127
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
22128
22128
  await api.post("/host/heartbeat", {
22129
22129
  host_id: hostId,
22130
22130
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -22796,7 +22796,7 @@ async function processClaudePairSessions(agents) {
22796
22796
  // cannot take it for itself — by the time it runs, the write it is looking
22797
22797
  // for may already have happened.
22798
22798
  snapshotPairConfig
22799
- } = await import("../claude-pair-runtime-ZHB5I7E6.js");
22799
+ } = await import("../claude-pair-runtime-JCCZH6OO.js");
22800
22800
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
22801
22801
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
22802
22802
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -36236,42 +36236,24 @@ var DAY_MS = 24 * HOUR_MS;
36236
36236
  var ALERT_AGE_SEVERITY_FLOORS = [{ afterMs: 24 * HOUR_MS, floor: "critical" }];
36237
36237
 
36238
36238
  // ../core/dist/conversations/metrics.js
36239
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
36240
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
36241
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
36239
36242
  var PERIOD_CONFIG = {
36240
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
36241
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
36242
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
36243
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
36244
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
36245
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
36246
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
36247
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
36248
+ all: { windowMs: null, bucket: "day" }
36243
36249
  };
36244
36250
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
36245
36251
 
36246
36252
  // ../core/dist/conversations/eval-scores.js
36247
36253
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
36248
- var PERIOD_CONFIG2 = {
36249
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
36250
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
36251
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
36252
- };
36253
-
36254
- // ../core/dist/conversations/eval-failures.js
36255
- var PERIOD_WINDOW_MS = {
36256
- "24h": 24 * 60 * 60 * 1e3,
36257
- "7d": 7 * 24 * 60 * 60 * 1e3,
36258
- "30d": 30 * 24 * 60 * 60 * 1e3
36259
- };
36260
-
36261
- // ../core/dist/conversations/eval-failure-categories.js
36262
- var PERIOD_WINDOW_MS2 = {
36263
- "24h": 24 * 60 * 60 * 1e3,
36264
- "7d": 7 * 24 * 60 * 60 * 1e3,
36265
- "30d": 30 * 24 * 60 * 60 * 1e3
36266
- };
36267
36254
 
36268
36255
  // ../core/dist/ratings/kanban-ratings.js
36269
36256
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
36270
- var PERIOD_CONFIG3 = {
36271
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
36272
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
36273
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
36274
- };
36275
36257
 
36276
36258
  // ../core/dist/triggers/registry.js
36277
36259
  var sources = /* @__PURE__ */ new Map();
@@ -36669,6 +36651,36 @@ var FLAG_REGISTRY = [
36669
36651
  // wearing a precise number, which is the failure this field invites.
36670
36652
  since: "0.28.618"
36671
36653
  },
36654
+ {
36655
+ key: "block-self-serve-org-creation",
36656
+ description: "Invite-only onboarding (ENG-11305): refuse self-serve organization creation. On: the signup trigger and /auth/ensure-person create no organization for a new account, POST /organizations returns 403, and the user is told organizations are by invitation. Still allowed: accepting an invitation, and staff organization creation - NOTHING else. A company-domain signup is no longer auto-joined to any existing organization: no signal available here proves domain ownership (a slug is not a domain, and organization_email_domains.verified_at is self-asserted by any org admin), so an invitation is the only door. Existing organizations are untouched. STAGE-WIDE ONLY: it is read inside Postgres (`self_serve_org_creation_blocked`), which sees only the stage value, never an org override - there is no org yet. Turn it OFF here to reopen self-serve signup.",
36657
+ flagType: "boolean",
36658
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
36659
+ // control that is "Done" and never in force. This literal is duplicated as
36660
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
36661
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
36662
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
36663
+ // halves of the gate would disagree on any host that set one.
36664
+ defaultValue: true,
36665
+ // An org override is meaningless here (no org exists when this evaluates)
36666
+ // and is ignored by the SQL half; stop org admins setting one that would
36667
+ // read as if it did something.
36668
+ platformAdminOnly: true,
36669
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
36670
+ // change this; it does not make changing it deliberate. Turning this flag
36671
+ // OFF reopens self-serve organization creation fleet-wide — every new org
36672
+ // carries the default comp subscription and can provision managed hosts —
36673
+ // and it is a single toggle on a list of toggles, with no org-level blast
36674
+ // radius to make anyone hesitate. `sensitive` is what forces the
36675
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
36676
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
36677
+ // override removal (`:360`), and the admin page routes it through a
36678
+ // confirm modal rather than an inline write (`page.tsx:179`).
36679
+ //
36680
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
36681
+ // of the structural projection (`schema-version.ts:37`).
36682
+ sensitive: true
36683
+ },
36672
36684
  {
36673
36685
  key: "agent-hours-billing-enabled",
36674
36686
  description: "Agent-hours (utilisation) billing (ENG-7910). Per-org gate; ships dark. When on for an org, its closed billing periods are settled into org_agent_hours_settlements from the plan/override agent-hours terms, and the customer billing surface shows used-vs-included hours + projected overage. Off = no settlement written, no charge, surface hidden. Launch prices are seeded in plan_billing_terms; flip on per-org for a controlled rollout.",
package/dist/mcp/index.js CHANGED
@@ -28454,42 +28454,24 @@ var DAY_MS = 24 * HOUR_MS;
28454
28454
  var ALERT_AGE_SEVERITY_FLOORS = [{ afterMs: 24 * HOUR_MS, floor: "critical" }];
28455
28455
 
28456
28456
  // ../core/dist/conversations/metrics.js
28457
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
28458
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
28459
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
28457
28460
  var PERIOD_CONFIG = {
28458
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
28459
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
28460
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
28461
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
28462
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
28463
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
28464
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
28465
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
28466
+ all: { windowMs: null, bucket: "day" }
28461
28467
  };
28462
28468
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
28463
28469
 
28464
28470
  // ../core/dist/conversations/eval-scores.js
28465
28471
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
28466
- var PERIOD_CONFIG2 = {
28467
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
28468
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
28469
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
28470
- };
28471
-
28472
- // ../core/dist/conversations/eval-failures.js
28473
- var PERIOD_WINDOW_MS = {
28474
- "24h": 24 * 60 * 60 * 1e3,
28475
- "7d": 7 * 24 * 60 * 60 * 1e3,
28476
- "30d": 30 * 24 * 60 * 60 * 1e3
28477
- };
28478
-
28479
- // ../core/dist/conversations/eval-failure-categories.js
28480
- var PERIOD_WINDOW_MS2 = {
28481
- "24h": 24 * 60 * 60 * 1e3,
28482
- "7d": 7 * 24 * 60 * 60 * 1e3,
28483
- "30d": 30 * 24 * 60 * 60 * 1e3
28484
- };
28485
28472
 
28486
28473
  // ../core/dist/ratings/kanban-ratings.js
28487
28474
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
28488
- var PERIOD_CONFIG3 = {
28489
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
28490
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
28491
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
28492
- };
28493
28475
 
28494
28476
  // ../core/dist/triggers/registry.js
28495
28477
  var sources = /* @__PURE__ */ new Map();
@@ -28887,6 +28869,36 @@ var FLAG_REGISTRY = [
28887
28869
  // wearing a precise number, which is the failure this field invites.
28888
28870
  since: "0.28.618"
28889
28871
  },
28872
+ {
28873
+ key: "block-self-serve-org-creation",
28874
+ description: "Invite-only onboarding (ENG-11305): refuse self-serve organization creation. On: the signup trigger and /auth/ensure-person create no organization for a new account, POST /organizations returns 403, and the user is told organizations are by invitation. Still allowed: accepting an invitation, and staff organization creation - NOTHING else. A company-domain signup is no longer auto-joined to any existing organization: no signal available here proves domain ownership (a slug is not a domain, and organization_email_domains.verified_at is self-asserted by any org admin), so an invitation is the only door. Existing organizations are untouched. STAGE-WIDE ONLY: it is read inside Postgres (`self_serve_org_creation_blocked`), which sees only the stage value, never an org override - there is no org yet. Turn it OFF here to reopen self-serve signup.",
28875
+ flagType: "boolean",
28876
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
28877
+ // control that is "Done" and never in force. This literal is duplicated as
28878
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
28879
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
28880
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
28881
+ // halves of the gate would disagree on any host that set one.
28882
+ defaultValue: true,
28883
+ // An org override is meaningless here (no org exists when this evaluates)
28884
+ // and is ignored by the SQL half; stop org admins setting one that would
28885
+ // read as if it did something.
28886
+ platformAdminOnly: true,
28887
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
28888
+ // change this; it does not make changing it deliberate. Turning this flag
28889
+ // OFF reopens self-serve organization creation fleet-wide — every new org
28890
+ // carries the default comp subscription and can provision managed hosts —
28891
+ // and it is a single toggle on a list of toggles, with no org-level blast
28892
+ // radius to make anyone hesitate. `sensitive` is what forces the
28893
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
28894
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
28895
+ // override removal (`:360`), and the admin page routes it through a
28896
+ // confirm modal rather than an inline write (`page.tsx:179`).
28897
+ //
28898
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
28899
+ // of the structural projection (`schema-version.ts:37`).
28900
+ sensitive: true
28901
+ },
28890
28902
  {
28891
28903
  key: "agent-hours-billing-enabled",
28892
28904
  description: "Agent-hours (utilisation) billing (ENG-7910). Per-org gate; ships dark. When on for an org, its closed billing periods are settled into org_agent_hours_settlements from the plan/override agent-hours terms, and the customer billing surface shows used-vs-included hours + projected overage. Off = no settlement written, no charge, surface hidden. Launch prices are seeded in plan_billing_terms; flip on per-org for a controlled rollout.",
@@ -42377,42 +42377,24 @@ var DAY_MS = 24 * HOUR_MS;
42377
42377
  var ALERT_AGE_SEVERITY_FLOORS = [{ afterMs: 24 * HOUR_MS, floor: "critical" }];
42378
42378
 
42379
42379
  // ../core/dist/conversations/metrics.js
42380
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
42381
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
42382
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
42380
42383
  var PERIOD_CONFIG = {
42381
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
42382
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
42383
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
42384
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
42385
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
42386
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
42387
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
42388
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
42389
+ all: { windowMs: null, bucket: "day" }
42384
42390
  };
42385
42391
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
42386
42392
 
42387
42393
  // ../core/dist/conversations/eval-scores.js
42388
42394
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
42389
- var PERIOD_CONFIG2 = {
42390
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
42391
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
42392
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
42393
- };
42394
-
42395
- // ../core/dist/conversations/eval-failures.js
42396
- var PERIOD_WINDOW_MS = {
42397
- "24h": 24 * 60 * 60 * 1e3,
42398
- "7d": 7 * 24 * 60 * 60 * 1e3,
42399
- "30d": 30 * 24 * 60 * 60 * 1e3
42400
- };
42401
-
42402
- // ../core/dist/conversations/eval-failure-categories.js
42403
- var PERIOD_WINDOW_MS2 = {
42404
- "24h": 24 * 60 * 60 * 1e3,
42405
- "7d": 7 * 24 * 60 * 60 * 1e3,
42406
- "30d": 30 * 24 * 60 * 60 * 1e3
42407
- };
42408
42395
 
42409
42396
  // ../core/dist/ratings/kanban-ratings.js
42410
42397
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
42411
- var PERIOD_CONFIG3 = {
42412
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
42413
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
42414
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
42415
- };
42416
42398
 
42417
42399
  // ../core/dist/triggers/registry.js
42418
42400
  var sources = /* @__PURE__ */ new Map();
@@ -42810,6 +42792,36 @@ var FLAG_REGISTRY = [
42810
42792
  // wearing a precise number, which is the failure this field invites.
42811
42793
  since: "0.28.618"
42812
42794
  },
42795
+ {
42796
+ key: "block-self-serve-org-creation",
42797
+ description: "Invite-only onboarding (ENG-11305): refuse self-serve organization creation. On: the signup trigger and /auth/ensure-person create no organization for a new account, POST /organizations returns 403, and the user is told organizations are by invitation. Still allowed: accepting an invitation, and staff organization creation - NOTHING else. A company-domain signup is no longer auto-joined to any existing organization: no signal available here proves domain ownership (a slug is not a domain, and organization_email_domains.verified_at is self-asserted by any org admin), so an invitation is the only door. Existing organizations are untouched. STAGE-WIDE ONLY: it is read inside Postgres (`self_serve_org_creation_blocked`), which sees only the stage value, never an org override - there is no org yet. Turn it OFF here to reopen self-serve signup.",
42798
+ flagType: "boolean",
42799
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
42800
+ // control that is "Done" and never in force. This literal is duplicated as
42801
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
42802
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
42803
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
42804
+ // halves of the gate would disagree on any host that set one.
42805
+ defaultValue: true,
42806
+ // An org override is meaningless here (no org exists when this evaluates)
42807
+ // and is ignored by the SQL half; stop org admins setting one that would
42808
+ // read as if it did something.
42809
+ platformAdminOnly: true,
42810
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
42811
+ // change this; it does not make changing it deliberate. Turning this flag
42812
+ // OFF reopens self-serve organization creation fleet-wide — every new org
42813
+ // carries the default comp subscription and can provision managed hosts —
42814
+ // and it is a single toggle on a list of toggles, with no org-level blast
42815
+ // radius to make anyone hesitate. `sensitive` is what forces the
42816
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
42817
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
42818
+ // override removal (`:360`), and the admin page routes it through a
42819
+ // confirm modal rather than an inline write (`page.tsx:179`).
42820
+ //
42821
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
42822
+ // of the structural projection (`schema-version.ts:37`).
42823
+ sensitive: true
42824
+ },
42813
42825
  {
42814
42826
  key: "agent-hours-billing-enabled",
42815
42827
  description: "Agent-hours (utilisation) billing (ENG-7910). Per-org gate; ships dark. When on for an org, its closed billing periods are settled into org_agent_hours_settlements from the plan/override agent-hours terms, and the customer billing surface shows used-vs-included hours + projected overage. Off = no settlement written, no charge, surface hidden. Launch prices are seeded in plan_billing_terms; flip on per-org for a controlled rollout.",
@@ -37007,42 +37007,24 @@ var DAY_MS = 24 * HOUR_MS;
37007
37007
  var ALERT_AGE_SEVERITY_FLOORS = [{ afterMs: 24 * HOUR_MS, floor: "critical" }];
37008
37008
 
37009
37009
  // ../core/dist/conversations/metrics.js
37010
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
37011
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
37012
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
37010
37013
  var PERIOD_CONFIG = {
37011
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
37012
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
37013
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
37014
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
37015
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
37016
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
37017
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
37018
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
37019
+ all: { windowMs: null, bucket: "day" }
37014
37020
  };
37015
37021
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
37016
37022
 
37017
37023
  // ../core/dist/conversations/eval-scores.js
37018
37024
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
37019
- var PERIOD_CONFIG2 = {
37020
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
37021
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
37022
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
37023
- };
37024
-
37025
- // ../core/dist/conversations/eval-failures.js
37026
- var PERIOD_WINDOW_MS = {
37027
- "24h": 24 * 60 * 60 * 1e3,
37028
- "7d": 7 * 24 * 60 * 60 * 1e3,
37029
- "30d": 30 * 24 * 60 * 60 * 1e3
37030
- };
37031
-
37032
- // ../core/dist/conversations/eval-failure-categories.js
37033
- var PERIOD_WINDOW_MS2 = {
37034
- "24h": 24 * 60 * 60 * 1e3,
37035
- "7d": 7 * 24 * 60 * 60 * 1e3,
37036
- "30d": 30 * 24 * 60 * 60 * 1e3
37037
- };
37038
37025
 
37039
37026
  // ../core/dist/ratings/kanban-ratings.js
37040
37027
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
37041
- var PERIOD_CONFIG3 = {
37042
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
37043
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
37044
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
37045
- };
37046
37028
 
37047
37029
  // ../core/dist/triggers/registry.js
37048
37030
  var sources = /* @__PURE__ */ new Map();
@@ -37440,6 +37422,36 @@ var FLAG_REGISTRY = [
37440
37422
  // wearing a precise number, which is the failure this field invites.
37441
37423
  since: "0.28.618"
37442
37424
  },
37425
+ {
37426
+ key: "block-self-serve-org-creation",
37427
+ description: "Invite-only onboarding (ENG-11305): refuse self-serve organization creation. On: the signup trigger and /auth/ensure-person create no organization for a new account, POST /organizations returns 403, and the user is told organizations are by invitation. Still allowed: accepting an invitation, and staff organization creation - NOTHING else. A company-domain signup is no longer auto-joined to any existing organization: no signal available here proves domain ownership (a slug is not a domain, and organization_email_domains.verified_at is self-asserted by any org admin), so an invitation is the only door. Existing organizations are untouched. STAGE-WIDE ONLY: it is read inside Postgres (`self_serve_org_creation_blocked`), which sees only the stage value, never an org override - there is no org yet. Turn it OFF here to reopen self-serve signup.",
37428
+ flagType: "boolean",
37429
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
37430
+ // control that is "Done" and never in force. This literal is duplicated as
37431
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
37432
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
37433
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
37434
+ // halves of the gate would disagree on any host that set one.
37435
+ defaultValue: true,
37436
+ // An org override is meaningless here (no org exists when this evaluates)
37437
+ // and is ignored by the SQL half; stop org admins setting one that would
37438
+ // read as if it did something.
37439
+ platformAdminOnly: true,
37440
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
37441
+ // change this; it does not make changing it deliberate. Turning this flag
37442
+ // OFF reopens self-serve organization creation fleet-wide — every new org
37443
+ // carries the default comp subscription and can provision managed hosts —
37444
+ // and it is a single toggle on a list of toggles, with no org-level blast
37445
+ // radius to make anyone hesitate. `sensitive` is what forces the
37446
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
37447
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
37448
+ // override removal (`:360`), and the admin page routes it through a
37449
+ // confirm modal rather than an inline write (`page.tsx:179`).
37450
+ //
37451
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
37452
+ // of the structural projection (`schema-version.ts:37`).
37453
+ sensitive: true
37454
+ },
37443
37455
  {
37444
37456
  key: "agent-hours-billing-enabled",
37445
37457
  description: "Agent-hours (utilisation) billing (ENG-7910). Per-org gate; ships dark. When on for an org, its closed billing periods are settled into org_agent_hours_settlements from the plan/override agent-hours terms, and the customer billing surface shows used-vs-included hours + projected overage. Off = no settlement written, no charge, surface hidden. Launch prices are seeded in plan_billing_terms; flip on per-org for a controlled rollout.",