@autotelic/joggle 0.8.0 → 0.8.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.
package/dist/check.js CHANGED
@@ -936,7 +936,7 @@ export const checkRepository = Effect.fn("joggle.check")(function* (options) {
936
936
  notes.push({
937
937
  ruleId: "joggle",
938
938
  reason: decisionTotals.replayed +
939
- " judgement(s) were replayed from the answer cache; no model was called",
939
+ " judgement(s) were replayed from a cache — the committed ledger and this machine's wire cache — and no model was called. A cold CI run has neither, so it judges nothing and names the same sites differently",
940
940
  });
941
941
  }
942
942
  const elapsedMs = (yield* Clock.currentTimeMillis) - started;
package/dist/decision.js CHANGED
@@ -189,7 +189,15 @@ export const layer = (options) => Layer.effectContext(Effect.gen(function* () {
189
189
  readOnly: options.readOnly,
190
190
  });
191
191
  const planAnswers = {
192
- get: (key) => Effect.map(answers.get(key), (stored) => Option.map(stored, answerOf)),
192
+ // An answer served from the ledger is a replay, and the stats said otherwise: a run
193
+ // whose 95 findings all came from cached verdicts reported "0 replayed, 0 calls", so
194
+ // the census could not tell a warm machine from a cold one.
195
+ get: (key) => Effect.tap(answers.get(key), (stored) => Option.isSome(stored)
196
+ ? Ref.update(stats, (current) => ({
197
+ ...current,
198
+ replayed: current.replayed + 1,
199
+ }))
200
+ : Effect.void).pipe(Effect.map((stored) => Option.map(stored, answerOf))),
193
201
  put: (key, answer) => answers.put(key, storedOf(answer)),
194
202
  };
195
203
  // Every answer is remembered per decision, so the committed cache is the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autotelic/joggle",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "description": "Cross-file patterns and idioms for TypeScript — the layer above the linter and the typechecker.",
6
6
  "license": "MIT",