instar 1.3.969 → 1.3.971

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.969",
3
+ "version": "1.3.971",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -123,7 +123,7 @@ function compute() {
123
123
  stateAuthored: false,
124
124
  nodeCount: 0, authorableCount: 0, freshCount: 0, staleCount: 0,
125
125
  neverAuthoredCount: 0, neverAuthoredWithinGrace: 0, neverAuthoredPastGrace: 0,
126
- authorFailedCount: 0, freshRatio: 1,
126
+ authorFailedCount: 0, freshRatio: null,
127
127
  };
128
128
  }
129
129
 
@@ -163,7 +163,10 @@ function compute() {
163
163
  authorFailedCount: authorFailed,
164
164
  // Denominator EXCLUDES never-authored-within-grace (grace period before a new
165
165
  // node counts as debt): fresh + stale + never-authored-past-grace.
166
- freshRatio: (fresh + stale + neverPast) === 0 ? 1 : Number((fresh / (fresh + stale + neverPast)).toFixed(4)),
166
+ // null (NOT 1) when there is nothing to divide by: an empty index has not
167
+ // earned a perfect score. Reporting 1 here made this ratchet structurally
168
+ // unable to fail on an empty map — the exact case it exists to catch.
169
+ freshRatio: (fresh + stale + neverPast) === 0 ? null : Number((fresh / (fresh + stale + neverPast)).toFixed(4)),
167
170
  };
168
171
  }
169
172
 
@@ -188,7 +191,19 @@ function main() {
188
191
 
189
192
  if (CHECK) {
190
193
  const failures = [];
191
- if (report.freshRatio < FLOORS.freshRatio) {
194
+ if (report.freshRatio === null && report.stateAuthored && report.nodeCount === 0) {
195
+ // An index EXISTS and yielded nothing authorable. That is the dangerous
196
+ // empty: the ratchet was asked to assess and could not, which must never
197
+ // read as a pass (reporting 1 here is what made this check structurally
198
+ // unable to fail on an empty map — the exact case it exists to catch).
199
+ failures.push('fresh ratio UNKNOWN — an authored index exists but contains ZERO nodes, so freshness could NOT be assessed (this is not a pass)');
200
+ } else if (report.freshRatio === null) {
201
+ // Either no authored state at all (the documented CI case) or an index whose
202
+ // nodes are all still within grace — legitimately too early to assess. NOT a
203
+ // failure, but it is NOT a pass either: say so out loud rather than
204
+ // letting a vacuous check read as a green one.
205
+ if (!QUIET) console.error('[cartographer-freshness] NOT ASSESSED — no authored cartographer state; this check gated on nothing.');
206
+ } else if (report.freshRatio < FLOORS.freshRatio) {
192
207
  failures.push(`fresh ratio ${report.freshRatio} < floor ${FLOORS.freshRatio}`);
193
208
  }
194
209
  if (report.neverAuthoredPastGrace > FLOORS.neverAuthoredPastGraceCeiling) {