@saturn-universe/projections 0.1.2-dev.10 → 0.1.2-dev.11

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 (2) hide show
  1. package/dist/team.js +10 -11
  2. package/package.json +2 -2
package/dist/team.js CHANGED
@@ -99,14 +99,12 @@ export function planTeam(s, e, run) {
99
99
  };
100
100
  return;
101
101
  }
102
- const incomingConcurrency = team.concurrency !== undefined
103
- ? teamConcurrency(team)
104
- : (current?.concurrency ?? teamConcurrency(team));
102
+ const incomingConcurrency = resolveEffectiveTeamConcurrency(team.concurrency, mainMembership.config);
105
103
  const mergedConcurrency = asyncCoordinator && current ? Math.max(current.concurrency, incomingConcurrency) : incomingConcurrency;
106
- const cappedConcurrency = resolveEffectiveTeamConcurrency(mainMembership.config.teamDefaultConcurrency !== undefined ? team.concurrency : mergedConcurrency, mainMembership.config);
104
+ const cappedConcurrency = resolveEffectiveTeamConcurrency(mergedConcurrency, mainMembership.config);
107
105
  s.teams[runId] = {
108
106
  runId,
109
- concurrency: Math.max(1, cappedConcurrency),
107
+ concurrency: cappedConcurrency,
110
108
  members: [mainMember, ...(current?.members.slice(1) ?? [])],
111
109
  tasks: [
112
110
  ...historicalTasks,
@@ -197,12 +195,13 @@ export function attachTeamMember(s, m) {
197
195
  const tasksMatch = asyncCoordinator
198
196
  ? expectedTasks.every((expected) => currentTasks.some((cur) => cur.memberId === expected.memberId && cur.task === expected.task))
199
197
  : canonicalJson(expectedTasks) === canonicalJson(currentTasks);
200
- const concurrency = rootConfig.teamDefaultConcurrency === undefined
201
- ? teamConcurrency(config)
202
- : resolveEffectiveTeamConcurrency(config.concurrency, rootConfig);
203
- const concurrencyValid = asyncCoordinator
204
- ? concurrency <= current.concurrency
205
- : concurrency === current.concurrency;
198
+ const concurrency = resolveEffectiveTeamConcurrency(config.concurrency, rootConfig);
199
+ // Legacy attachments with an explicit request must also fit the projected limit before capping.
200
+ const legacyRequestExceedsLimit = rootConfig.teamDefaultConcurrency === undefined &&
201
+ config.concurrency !== undefined &&
202
+ config.concurrency > current.concurrency;
203
+ const concurrencyValid = !legacyRequestExceedsLimit &&
204
+ (asyncCoordinator ? concurrency <= current.concurrency : concurrency === current.concurrency);
206
205
  if (!worker ||
207
206
  !concurrencyValid ||
208
207
  !tasksMatch ||
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@saturn-universe/projections",
3
- "version": "0.1.2-dev.10",
3
+ "version": "0.1.2-dev.11",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "dependencies": {
10
- "@saturn-universe/core": "0.1.2-dev.10"
10
+ "@saturn-universe/core": "0.1.2-dev.11"
11
11
  },
12
12
  "exports": {
13
13
  ".": {