Skip to content

Commit 164ff14

Browse files
authored
Merge pull request #91 from PatrickSys/feat/phase-8-tighten-search-contract
feat: tighten search contract (Phase 8 - DISC-01 + SAFE-01)
2 parents 9440dc6 + fa79e90 commit 164ff14

File tree

10 files changed

+1288
-44
lines changed

10 files changed

+1288
-44
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"chokidar": "^3.6.0",
142142
"fuse.js": "^7.0.0",
143143
"glob": "^10.3.10",
144-
"hono": "^4.12.5",
144+
"hono": "^4.12.12",
145145
"ignore": "^5.3.1",
146146
"typescript": "^5.3.3",
147147
"uuid": "^9.0.1",
@@ -175,7 +175,7 @@
175175
],
176176
"overrides": {
177177
"@modelcontextprotocol/sdk>ajv": "8.18.0",
178-
"@modelcontextprotocol/sdk>@hono/node-server": "1.19.11",
178+
"@modelcontextprotocol/sdk>@hono/node-server": "1.19.13",
179179
"@modelcontextprotocol/sdk>express-rate-limit": "8.2.2",
180180
"@huggingface/transformers>onnxruntime-node": "1.24.2",
181181
"path-to-regexp": "8.4.0",
@@ -185,7 +185,7 @@
185185
"readdirp>picomatch": "2.3.2",
186186
"minimatch": "10.2.3",
187187
"rollup": "4.59.0",
188-
"hono@<4.12.7": ">=4.12.7",
188+
"hono@<4.12.12": ">=4.12.12",
189189
"tmp": "0.2.4"
190190
}
191191
}

pnpm-lock.yaml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/preflight/evidence-lock.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ interface BuildEvidenceLockInput {
4444
searchQualityStatus?: 'ok' | 'low_confidence';
4545
/** Impact coverage: number of known callers covered by results */
4646
impactCoverage?: { covered: number; total: number };
47+
/** Index age signal: fresh (<24h), aging (24h–7d), stale (>7d) */
48+
indexFreshness?: 'fresh' | 'aging' | 'stale';
4749
}
4850

4951
function strengthFactor(strength: EvidenceStrength): number {
@@ -204,8 +206,22 @@ export function buildEvidenceLock(input: BuildEvidenceLockInput): EvidenceLock {
204206
}
205207
}
206208

209+
// Freshness gate: stale index forces block; aging index warns without changing status.
210+
if (input.indexFreshness === 'stale') {
211+
status = 'block';
212+
nextAction = 'Index is stale (>7 days). Run refresh_index before editing.';
213+
if (!gaps.includes('Index is stale')) {
214+
gaps.push('Index is stale (>7 days) — results may be significantly out of date');
215+
}
216+
} else if (input.indexFreshness === 'aging') {
217+
if (!gaps.includes('Index is aging')) {
218+
gaps.push('Index is aging (>24h) — results may not reflect recent changes');
219+
}
220+
}
221+
207222
const readyToEdit =
208223
status === 'pass' &&
224+
input.indexFreshness !== 'stale' &&
209225
(!epistemicStress || !epistemicStress.abstain) &&
210226
input.searchQualityStatus !== 'low_confidence';
211227

0 commit comments

Comments
 (0)