@sanity/ailf 3.1.0 → 3.1.1

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.
@@ -143,16 +143,18 @@ export class CalculateScoresStep {
143
143
  // The full responseOutput lives in the GCS artifact; PublishReportStep
144
144
  // later strips it from the inline Content Lake document when this
145
145
  // upload succeeds.
146
+ //
147
+ // The emits flow through `ctx.artifactWriter`, which the composition
148
+ // root wraps in `AccumulatingArtifactWriter`. That's where the
149
+ // authoritative merged ref is built; `FinalizeRunStep` reads it
150
+ // straight from the accumulator, so producer-side registration on
151
+ // `state.artifactRefs` would only clobber the accumulator's full set
152
+ // with a partial single-entry ref.
153
+ //
146
154
  // W0050 — ctx.artifactWriter is always present; no guard needed.
147
155
  const testResults = tryReadTestResults(ctx.config.rootDir);
148
156
  if (testResults?.length) {
149
- const artifactRef = await uploadTestOutputs(ctx.artifactWriter, ctx.runId, testResults, ctx.config.mode);
150
- if (artifactRef) {
151
- state.artifactRefs = {
152
- ...state.artifactRefs,
153
- testOutputs: artifactRef,
154
- };
155
- }
157
+ await uploadTestOutputs(ctx.artifactWriter, ctx.runId, testResults, ctx.config.mode);
156
158
  }
157
159
  const criticalSuffix = belowCritical.length > 0
158
160
  ? ` (${belowCritical.length} area(s) below critical threshold: ${belowCritical.join(", ")})`
@@ -86,11 +86,12 @@ export class FinalizeRunStep {
86
86
  });
87
87
  // W0051 revisit: the composition-root wraps `ctx.artifactWriter` in
88
88
  // `AccumulatingArtifactWriter`, which keeps a map of every ref any
89
- // producer emitted this run. Merge that into `state.artifactRefs` so
90
- // the manifest reflects the FULL set not just the subset producers
91
- // happened to register manually. When the writer is a NoOp / plain
92
- // decorator without accumulation, `aggregated` stays empty and the
93
- // manifest falls back to the producer-side registration.
89
+ // producer emitted this run the authoritative FULL set, merged by
90
+ // entry key. `state.artifactRefs` is a producer-side fallback for
91
+ // writers that don't accumulate (NoOp / plain decorators). The
92
+ // accumulator wins per type when both exist, because producer-side
93
+ // registrations tend to capture only the last ref from a parallel
94
+ // batch and would otherwise clobber the merged entries list.
94
95
  //
95
96
  // W0058: `findAccumulator` unwraps `InstrumentedArtifactWriter` too
96
97
  // so the manifest stays fully populated when `AILF_UPLOAD_METRICS=1`.
@@ -99,8 +100,8 @@ export class FinalizeRunStep {
99
100
  ? accumulator.getAccumulatedArtifactRefs()
100
101
  : {};
101
102
  const artifacts = {
102
- ...aggregated,
103
103
  ...(state.artifactRefs ?? {}),
104
+ ...aggregated,
104
105
  };
105
106
  const manifest = {
106
107
  version: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ailf",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -52,8 +52,8 @@
52
52
  "@types/node": "^22.13.1",
53
53
  "tsx": "^4.19.2",
54
54
  "typescript": "^5.7.3",
55
- "@sanity/ailf-shared": "0.1.0",
56
- "@sanity/ailf-core": "0.1.0"
55
+ "@sanity/ailf-core": "0.1.0",
56
+ "@sanity/ailf-shared": "0.1.0"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "tsc && tsx scripts/bundle-workspace-deps.ts",