feat(ms-ai-architect): Spor 3 Port 3 (rapporterende gulv) — KB-tillit-signal i SessionStart [skip-docs]
Det rapporterende gulvet (§4 Port 3, P3b): SessionStart-hooken surfacer en KB-tillit-énlinjer fra cachet verified-staleness-report.json. Et GULV, ikke en gate (§4c — unngå alarm-tretthet på 84 %-signal). summarizeTrustFreshness (detection-schedule.mjs, ren, speiler summarizeSkillQuality): surfacer KUN drift (stale-since-verified) + kontraktbrudd (unverified) — det handlingsbare «bekreft mot kilde»-settet. unmigrated (Spor-1-backlog, 306 i dag) ekskluderes bevisst: ved det volumet ville det fyre hver økt og bli støy; migrerings-censusen hører i CT5 (P3c). Tolererer manglende/malformed cache → null (gitignored, fraværende i fersk klon, krasjer aldri hooken). session-start-context.mjs: leser cachen read-only (samme mønster som skill-quality-blokken), dytter linjen når den finnes. Ende-til-ende verifisert: injisert stale-rapport → «KB-tillit: 3 filer driftet siden verifisering, 1 uverifisert — bekreft mot kilde (aldri auto-fiks)»; ekte korpus (306 unmigrated) → taus (ingen falsk alarm). TDD (Iron Law): 8 nye tester. Suite 612/612. Plugin-validering PASS.
This commit is contained in:
parent
fea5df5e68
commit
08e7e72c62
3 changed files with 116 additions and 0 deletions
|
|
@ -300,3 +300,38 @@ export function summarizeSkillQuality(cache) {
|
|||
const noun = below.length === 1 ? 'skill' : 'skills';
|
||||
return `Skill-kvalitet: ${below.length} ${noun} < ${target} % (${below.join(', ')})`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the KB-trust reporting floor one-liner (Spor 3 Port 3, P3b) for the
|
||||
* SessionStart hook. Pure; tolerant of partial/missing reports. Mirrors
|
||||
* summarizeSkillQuality.
|
||||
*
|
||||
* Consumes the CACHED verified-staleness-report.json (produced by
|
||||
* report-verified-staleness.mjs on the KB-refresh cadence) — it NEVER judges
|
||||
* live. That cache is gitignored (derived/regenerable), so it is ABSENT in a
|
||||
* fresh clone — this MUST tolerate a missing/malformed report → null and never
|
||||
* crash the hook.
|
||||
*
|
||||
* A REPORTING FLOOR, not a gate (§4c — avoid alarm fatigue on an 84 % signal):
|
||||
* surfaces ONLY drift (stale-since-verified) + contract breaches (unverified),
|
||||
* the actionable "confirm against source" set. `unmigrated` (the Spor-1 backlog,
|
||||
* 306 today) is DELIBERATELY excluded: at that volume it would fire every
|
||||
* session and become noise; the migration census belongs to CT5 (P3c).
|
||||
*
|
||||
* @param {object|null} report parsed verified-staleness-report.json
|
||||
* ({counts: {stale, unverified, ...}})
|
||||
* @returns {string|null}
|
||||
*/
|
||||
export function summarizeTrustFreshness(report) {
|
||||
if (!report || typeof report !== 'object') return null;
|
||||
const counts = report.counts;
|
||||
if (!counts || typeof counts !== 'object') return null;
|
||||
const stale = Number(counts.stale) || 0;
|
||||
const unverified = Number(counts.unverified) || 0;
|
||||
if (stale === 0 && unverified === 0) return null;
|
||||
|
||||
const parts = [];
|
||||
if (stale > 0) parts.push(`${stale} ${stale === 1 ? 'fil' : 'filer'} driftet siden verifisering`);
|
||||
if (unverified > 0) parts.push(`${unverified} uverifisert`);
|
||||
return `KB-tillit: ${parts.join(', ')} — bekreft mot kilde (aldri auto-fiks)`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue