instar 1.3.830 → 1.3.832
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +83 -12
- package/dist/commands/server.js.map +1 -1
- package/dist/core/AutonomousRealCheckAnnotator.d.ts +105 -0
- package/dist/core/AutonomousRealCheckAnnotator.d.ts.map +1 -0
- package/dist/core/AutonomousRealCheckAnnotator.js +122 -0
- package/dist/core/AutonomousRealCheckAnnotator.js.map +1 -0
- package/dist/core/AutonomousRunStore.d.ts +29 -0
- package/dist/core/AutonomousRunStore.d.ts.map +1 -1
- package/dist/core/AutonomousRunStore.js +38 -0
- package/dist/core/AutonomousRunStore.js.map +1 -1
- package/dist/core/BackupManager.d.ts.map +1 -1
- package/dist/core/BackupManager.js +47 -1
- package/dist/core/BackupManager.js.map +1 -1
- package/dist/core/CircuitBreakingIntelligenceProvider.d.ts +12 -0
- package/dist/core/CircuitBreakingIntelligenceProvider.d.ts.map +1 -1
- package/dist/core/CircuitBreakingIntelligenceProvider.js +56 -4
- package/dist/core/CircuitBreakingIntelligenceProvider.js.map +1 -1
- package/dist/core/CompletionEvaluator.d.ts +62 -2
- package/dist/core/CompletionEvaluator.d.ts.map +1 -1
- package/dist/core/CompletionEvaluator.js +124 -6
- package/dist/core/CompletionEvaluator.js.map +1 -1
- package/dist/core/DecisionQualityRecorderImpl.d.ts +192 -0
- package/dist/core/DecisionQualityRecorderImpl.d.ts.map +1 -0
- package/dist/core/DecisionQualityRecorderImpl.js +363 -0
- package/dist/core/DecisionQualityRecorderImpl.js.map +1 -0
- package/dist/core/IntelligenceRouter.d.ts +33 -0
- package/dist/core/IntelligenceRouter.d.ts.map +1 -1
- package/dist/core/IntelligenceRouter.js +240 -54
- package/dist/core/IntelligenceRouter.js.map +1 -1
- package/dist/core/JudgmentProvenanceLog.d.ts +102 -2
- package/dist/core/JudgmentProvenanceLog.d.ts.map +1 -1
- package/dist/core/JudgmentProvenanceLog.js +239 -11
- package/dist/core/JudgmentProvenanceLog.js.map +1 -1
- package/dist/core/MessagingToneGate.d.ts +30 -0
- package/dist/core/MessagingToneGate.d.ts.map +1 -1
- package/dist/core/MessagingToneGate.js +63 -0
- package/dist/core/MessagingToneGate.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +11 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +32 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
- package/dist/core/WriteDomainRegistry.js +24 -0
- package/dist/core/WriteDomainRegistry.js.map +1 -1
- package/dist/core/decisionGradingPass.d.ts +89 -0
- package/dist/core/decisionGradingPass.d.ts.map +1 -0
- package/dist/core/decisionGradingPass.js +188 -0
- package/dist/core/decisionGradingPass.js.map +1 -0
- package/dist/core/decisionQualityTypes.d.ts +170 -0
- package/dist/core/decisionQualityTypes.d.ts.map +1 -0
- package/dist/core/decisionQualityTypes.js +85 -0
- package/dist/core/decisionQualityTypes.js.map +1 -0
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +6 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/machineCoherenceManifest.d.ts.map +1 -1
- package/dist/core/machineCoherenceManifest.js +4 -0
- package/dist/core/machineCoherenceManifest.js.map +1 -1
- package/dist/core/types.d.ts +69 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/data/provenanceCoverage.d.ts +156 -0
- package/dist/data/provenanceCoverage.d.ts.map +1 -0
- package/dist/data/provenanceCoverage.js +674 -0
- package/dist/data/provenanceCoverage.js.map +1 -0
- package/dist/monitoring/ExternalHogDecisionStore.d.ts +256 -0
- package/dist/monitoring/ExternalHogDecisionStore.d.ts.map +1 -0
- package/dist/monitoring/ExternalHogDecisionStore.js +481 -0
- package/dist/monitoring/ExternalHogDecisionStore.js.map +1 -0
- package/dist/monitoring/ExternalHogRealAdapters.d.ts +6 -2
- package/dist/monitoring/ExternalHogRealAdapters.d.ts.map +1 -1
- package/dist/monitoring/ExternalHogRealAdapters.js +2 -2
- package/dist/monitoring/ExternalHogRealAdapters.js.map +1 -1
- package/dist/monitoring/ExternalHogScanTick.d.ts +95 -3
- package/dist/monitoring/ExternalHogScanTick.d.ts.map +1 -1
- package/dist/monitoring/ExternalHogScanTick.js +102 -9
- package/dist/monitoring/ExternalHogScanTick.js.map +1 -1
- package/dist/monitoring/ExternalHogSentinel.d.ts +71 -3
- package/dist/monitoring/ExternalHogSentinel.d.ts.map +1 -1
- package/dist/monitoring/ExternalHogSentinel.js +126 -2
- package/dist/monitoring/ExternalHogSentinel.js.map +1 -1
- package/dist/monitoring/ExternalHogServerPrimitives.d.ts +10 -2
- package/dist/monitoring/ExternalHogServerPrimitives.d.ts.map +1 -1
- package/dist/monitoring/ExternalHogServerPrimitives.js +1 -1
- package/dist/monitoring/ExternalHogServerPrimitives.js.map +1 -1
- package/dist/monitoring/FeatureMetricsLedger.d.ts +304 -0
- package/dist/monitoring/FeatureMetricsLedger.d.ts.map +1 -1
- package/dist/monitoring/FeatureMetricsLedger.js +731 -0
- package/dist/monitoring/FeatureMetricsLedger.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +2 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +55 -1
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +15 -1
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/fileRoutes.d.ts.map +1 -1
- package/dist/server/fileRoutes.js +9 -0
- package/dist/server/fileRoutes.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +334 -5
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +65 -65
- package/src/data/provenanceCoverage.ts +850 -0
- package/src/scaffold/templates/jobs/instar/llm-decision-grading.md +32 -0
- package/src/scaffold/templates.ts +2 -1
- package/upgrades/1.3.831.md +30 -0
- package/upgrades/1.3.832.md +22 -0
- package/upgrades/side-effects/llm-decision-quality-meter.md +95 -0
- package/upgrades/side-effects/messaging-tone-gate-provenance-enrollment.md +68 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExternalHogDecisionStore — the DURABLE per-ledgerKey decision record behind the external-hog
|
|
3
|
+
* kill/leave grading (docs/specs/llm-decision-quality-meter.md §5.3 + §5.4.5; the review
|
|
4
|
+
* established the carrier this grading needs did not exist: the P19 kill-ledger state is
|
|
5
|
+
* in-memory-only, kill-records-only, with a 1h retention — shorter than the 6h evidence window).
|
|
6
|
+
*
|
|
7
|
+
* On-disk: `<stateDir>/state/external-hog-decisions.json` — the `.instar/state/` runtime-state
|
|
8
|
+
* subdir (rides the existing gitignore; the same subdir the judgment-provenance log uses).
|
|
9
|
+
* At-rest posture mirrors ExternalHogArmStore exactly: 0600 via atomic tmp + fsync + rename
|
|
10
|
+
* writes, FAIL-CLOSED reads (missing / unreadable / corrupt / wrong-shape → empty store, never a
|
|
11
|
+
* throw; a malformed individual record is dropped, never half-trusted). Contents are content-free
|
|
12
|
+
* (hashes, pids, timestamps, enums) — never argv, never model output. The file is
|
|
13
|
+
* backup-excluded (BLOCKED_PATH_PREFIXES + NEVER_BACKUP_PATH_SEGMENTS, P1) and NEVER_SERVED
|
|
14
|
+
* (fileRoutes, P1): it is grading GROUND TRUTH — serve-deny implies edit-deny.
|
|
15
|
+
*
|
|
16
|
+
* SLOT SEMANTICS (§5.3, ADV r3): per ledgerKey the store holds the LATEST decision PLUS the most
|
|
17
|
+
* recent in-window ENACTED-kill decision retained ALONGSIDE — a kill's evidence slot is never
|
|
18
|
+
* evicted by later same-key decisions before its window closes, so a same-commandHash flood
|
|
19
|
+
* cannot force a premature `unknown` on a kill.
|
|
20
|
+
*
|
|
21
|
+
* GRADE-ON-SUPERSEDE (§5.3, ADV/DC r3): writing a new decision for ledgerKey K FIRST applies the
|
|
22
|
+
* positive-evidence rules against the OUTGOING record(s) — the supersede event IS the
|
|
23
|
+
* positive-evidence event for the recurrence rules; within-tick ordering is pinned, not assumed —
|
|
24
|
+
* and returns any grade results to the caller BEFORE replacement. A superseded record whose rules
|
|
25
|
+
* yield nothing ages out as `unknown` (stated, not silent).
|
|
26
|
+
*
|
|
27
|
+
* RETENTION (§5.3, DC r3): pruned on write at
|
|
28
|
+
* `max(evidenceWindowMs + gradingSlackMs, killLedgerBreakerWindowMs)` — the grading slack
|
|
29
|
+
* (default 2h ≥ 2× the grading job's hourly cadence) closes the race where an entry becomes
|
|
30
|
+
* gradeable at exactly the age it becomes prunable; the evidence window is the config knob
|
|
31
|
+
* (`provenance.quality.evidenceWindowHours`, inline default 6h — deliberately unseeded, §5.7) and
|
|
32
|
+
* retention DERIVES from it, so tuning the window can never silently outrun the carrier.
|
|
33
|
+
*
|
|
34
|
+
* CLOCK: the store keeps its OWN injected WALL clock (epoch ms, default Date.now) — the scan
|
|
35
|
+
* tick's monotonic hrtime clock must never be persisted (it restarts at 0 with the process).
|
|
36
|
+
*
|
|
37
|
+
* The pure evidence-rule predicates (§5.4.5) are exported at module level: the positive-evidence
|
|
38
|
+
* rules (`hog-respawn-wrong-v1`, `hog-leave-recurrence-v1`) run in scan ticks via
|
|
39
|
+
* grade-on-supersede here; the window-close rule (`hog-sustained-right-v1`, owner
|
|
40
|
+
* `DecisionGrading`) is exported for the P9 grading endpoint to drive over `list()` — this store
|
|
41
|
+
* NEVER emits sustained-right events itself (the sentinel is not that rule's registered owner).
|
|
42
|
+
*/
|
|
43
|
+
import fs from 'node:fs';
|
|
44
|
+
import path from 'node:path';
|
|
45
|
+
import { lstartToEpochMs } from './ExternalHogFactBuilder.js';
|
|
46
|
+
import { getRule } from '../data/provenanceCoverage.js';
|
|
47
|
+
// ── Registered evidence-rule ids (§5.4.5 — immutable, versioned) ────────────
|
|
48
|
+
export const HOG_RESPAWN_WRONG_RULE_ID = 'hog-respawn-wrong-v1';
|
|
49
|
+
export const HOG_LEAVE_RECURRENCE_RULE_ID = 'hog-leave-recurrence-v1';
|
|
50
|
+
export const HOG_SUSTAINED_RIGHT_RULE_ID = 'hog-sustained-right-v1';
|
|
51
|
+
export const HOG_ENACTED_DISPOSITION_RULE_ID = 'hog-enacted-disposition-v1';
|
|
52
|
+
/** The sentinel's registered owning component for its rules (§5.4.2 — the
|
|
53
|
+
* annotate chokepoint rejects an annotation whose gradedBy.component is not
|
|
54
|
+
* the ruleId's registered owner; a unit test pins this against RULE_REGISTRY). */
|
|
55
|
+
export const EXTERNAL_HOG_SENTINEL_COMPONENT = 'ExternalHogSentinel';
|
|
56
|
+
/**
|
|
57
|
+
* Sanity guard the tests pin: the sentinel-emitted rules must be registered to
|
|
58
|
+
* EXTERNAL_HOG_SENTINEL_COMPONENT (and sustained-right must NOT be — it belongs
|
|
59
|
+
* to the grading job). Drift here would silently zero the hog grades at the
|
|
60
|
+
* chokepoint's owner check.
|
|
61
|
+
*/
|
|
62
|
+
export function hogRuleRegistryAgrees() {
|
|
63
|
+
const sentinelOwned = [HOG_RESPAWN_WRONG_RULE_ID, HOG_LEAVE_RECURRENCE_RULE_ID, HOG_ENACTED_DISPOSITION_RULE_ID]
|
|
64
|
+
.every((id) => getRule(id)?.owningComponent === EXTERNAL_HOG_SENTINEL_COMPONENT);
|
|
65
|
+
const gradingOwned = getRule(HOG_SUSTAINED_RIGHT_RULE_ID)?.owningComponent === 'DecisionGrading';
|
|
66
|
+
return sentinelOwned && gradingOwned;
|
|
67
|
+
}
|
|
68
|
+
// ── Record + evidence types ─────────────────────────────────────────────────
|
|
69
|
+
/** Enacted dispositions that COUNT as an enacted kill (§5.3 — the ONLY entries
|
|
70
|
+
* to the kill-grading rules; everything else ages out `unknown`). */
|
|
71
|
+
export const HOG_KILL_ENACTED = new Set(['killed', 'sigterm-exited']);
|
|
72
|
+
/** Build the evidence view from one tick's outcomes + the tick's parsed table. */
|
|
73
|
+
export function buildScanEvidenceView(outcomes, table) {
|
|
74
|
+
const candidates = outcomes.map((o) => ({
|
|
75
|
+
pid: o.decision.targetTuple.pid,
|
|
76
|
+
startTimeMs: o.decision.targetTuple.startTimeMs,
|
|
77
|
+
commandHash: o.decision.commandHash,
|
|
78
|
+
}));
|
|
79
|
+
return {
|
|
80
|
+
candidates,
|
|
81
|
+
aliveStartTimeMs: (pid) => {
|
|
82
|
+
const row = table.find((r) => r.pid === pid);
|
|
83
|
+
if (!row)
|
|
84
|
+
return undefined; // no live process at that pid
|
|
85
|
+
return lstartToEpochMs(row.startTime); // number = orderable; null = un-orderable
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
// ── The pure §5.4.5 evidence-rule predicates ────────────────────────────────
|
|
90
|
+
/** Are these the SAME stored decision? (Reference equality dies at hydration —
|
|
91
|
+
* latest and kill may be two parses of one record; compare identity fields.) */
|
|
92
|
+
function sameStoredDecision(a, b) {
|
|
93
|
+
return a.atMs === b.atMs && a.correlationId === b.correlationId
|
|
94
|
+
&& a.enacted === b.enacted && a.commandHash === b.commandHash
|
|
95
|
+
&& a.targetTuple.pid === b.targetTuple.pid;
|
|
96
|
+
}
|
|
97
|
+
/** Is `candidate` provably the SAME process as the record's target (pid + orderable equal start)? */
|
|
98
|
+
function isSameProcess(candidate, target) {
|
|
99
|
+
return candidate.pid === target.pid
|
|
100
|
+
&& candidate.startTimeMs !== null
|
|
101
|
+
&& target.startTimeMs !== null
|
|
102
|
+
&& candidate.startTimeMs === target.startTimeMs;
|
|
103
|
+
}
|
|
104
|
+
/** Is the record's evidence window still open at `nowMs`? (Negative/skewed clocks fail closed → not in window.) */
|
|
105
|
+
function inWindow(record, nowMs) {
|
|
106
|
+
const age = nowMs - record.atMs;
|
|
107
|
+
return Number.isFinite(age) && age >= 0 && age <= record.effectiveWindowMs;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* `hog-respawn-wrong-v1` (deterministic-proof; §5.4.5): a kill is graded `wrong` ONLY IF, within
|
|
111
|
+
* the bounded window, a same-commandHash CANDIDATE respawns AND the kill-time ordering test
|
|
112
|
+
* re-runs TRUE at evidence time — a currently-alive process sits at the killed process's recorded
|
|
113
|
+
* parent pid with a start-time ≤ the killed child's recorded start-time, proving the orphan
|
|
114
|
+
* determination was false. Spoof-proof in both directions (start-times cannot be forged old):
|
|
115
|
+
* a respawn under a genuinely NEW owner (the operator reopened the editor — the live parent
|
|
116
|
+
* started AFTER the killed child, or no live parent exists) fails the ordering test and grades
|
|
117
|
+
* `unknown`, never `wrong`; un-orderable start-times → `unknown`.
|
|
118
|
+
*
|
|
119
|
+
* Preconditions: verdict 'kill' actually ENACTED (`killed`/`sigterm-exited`) — would-kill /
|
|
120
|
+
* deferred / aborted / decider-unavailable / breaker-held decisions are NEVER graded by this rule
|
|
121
|
+
* (they age out `unknown`). Returns null when no evidence event applies (no respawn, out of
|
|
122
|
+
* window, preconditions unmet).
|
|
123
|
+
*/
|
|
124
|
+
export function evaluateHogRespawnWrong(record, scan, nowMs) {
|
|
125
|
+
if (record.verdict !== 'kill')
|
|
126
|
+
return null; // grades attribute to the LLM verdict (§5.3)
|
|
127
|
+
if (!HOG_KILL_ENACTED.has(record.enacted))
|
|
128
|
+
return null; // only ENACTED kills enter kill-grading
|
|
129
|
+
if (!inWindow(record, nowMs))
|
|
130
|
+
return null; // out of window → the window-close rule's territory
|
|
131
|
+
// Trigger: a same-commandHash CANDIDATE that is not provably the killed process itself.
|
|
132
|
+
const respawned = scan.candidates.some((c) => c.commandHash === record.commandHash && !isSameProcess(c, record.targetTuple));
|
|
133
|
+
if (!respawned)
|
|
134
|
+
return null; // no evidence event
|
|
135
|
+
// The kill-time ordering test, re-run at evidence time.
|
|
136
|
+
const parentPid = record.ownerTuple.parentPid;
|
|
137
|
+
if (parentPid === undefined)
|
|
138
|
+
return 'unknown'; // un-evaluable (never occurs on enacted kills by construction)
|
|
139
|
+
const aliveParentStartMs = scan.aliveStartTimeMs(parentPid);
|
|
140
|
+
if (aliveParentStartMs === undefined)
|
|
141
|
+
return 'unknown'; // no live parent → new/ownerless respawn → never wrong
|
|
142
|
+
if (aliveParentStartMs === null || record.targetTuple.startTimeMs === null)
|
|
143
|
+
return 'unknown'; // un-orderable
|
|
144
|
+
return aliveParentStartMs <= record.targetTuple.startTimeMs ? 'wrong' : 'unknown';
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* `hog-sustained-right-v1` (negative-evidence; §5.4.5): a kill whose commandHash did NOT re-flag
|
|
148
|
+
* as a CANDIDATE within the window, where the floor recorded the owner dead at kill time
|
|
149
|
+
* (floorPermitted ⟹ the owner-dead invariant held), grades `right` at WINDOW CLOSE. Sensor
|
|
150
|
+
* bound, stated: candidate visibility is sustained-CPU processes only — a quiet respawn is
|
|
151
|
+
* invisible, so this grade carries negative-evidence strength, never proof.
|
|
152
|
+
*
|
|
153
|
+
* Owner: `DecisionGrading` (the P9 grading endpoint drives this over `list()`); the sentinel
|
|
154
|
+
* never emits it. Returns null while the window is open, on any non-enacted-kill record, or when
|
|
155
|
+
* a re-flag was recorded inside the window.
|
|
156
|
+
*/
|
|
157
|
+
export function evaluateHogSustainedRight(record, nowMs) {
|
|
158
|
+
if (record.verdict !== 'kill')
|
|
159
|
+
return null;
|
|
160
|
+
if (!HOG_KILL_ENACTED.has(record.enacted))
|
|
161
|
+
return null;
|
|
162
|
+
if (!record.floorPermitted)
|
|
163
|
+
return null; // precondition: floor recorded owner dead at kill time
|
|
164
|
+
const age = nowMs - record.atMs;
|
|
165
|
+
if (!Number.isFinite(age) || age <= record.effectiveWindowMs)
|
|
166
|
+
return null; // window not closed yet
|
|
167
|
+
if (record.reFlaggedAtMs !== undefined && record.reFlaggedAtMs - record.atMs <= record.effectiveWindowMs) {
|
|
168
|
+
return null; // a same-key candidate re-flagged in-window → negative evidence destroyed
|
|
169
|
+
}
|
|
170
|
+
return 'right';
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* `hog-leave-recurrence-v1` (recurrence-proxy; §5.4.5): applies ONLY to decisions where
|
|
174
|
+
* `verdict === 'leave'` AND `enacted === 'alert-only-model-spared'` (a kill-verdict held by the
|
|
175
|
+
* breaker/governor/floor is NEVER graded against the classifier) AND `floorPermitted` was true at
|
|
176
|
+
* decision time (sparing an owner-alive hog is correct behavior with no gradeable
|
|
177
|
+
* counterfactual). Within those preconditions: the SAME PROCESS (matching targetTuple pid +
|
|
178
|
+
* start-time) re-flagging as a sustained hog within the window grades the leave `wrong`; a
|
|
179
|
+
* DIFFERENT process with the same commandHash grades `unknown` (a lookalike spawned by any
|
|
180
|
+
* same-uid process is not a counterfactual for the specific process the classifier spared — and
|
|
181
|
+
* cannot fabricate a `wrong`). No-recurrence `right` at window close belongs to the grading job,
|
|
182
|
+
* not this predicate.
|
|
183
|
+
*
|
|
184
|
+
* `nowMs` bounds the check to the record's evidence window (additive to the spec's pinned
|
|
185
|
+
* signature — the predicate is window-bounded by §5.4.5 and must not rely on caller discipline).
|
|
186
|
+
*/
|
|
187
|
+
export function evaluateHogLeaveRecurrence(record, currentCandidateSignature, nowMs) {
|
|
188
|
+
if (record.verdict !== 'leave')
|
|
189
|
+
return null;
|
|
190
|
+
if (record.enacted !== 'alert-only-model-spared')
|
|
191
|
+
return null;
|
|
192
|
+
if (!record.floorPermitted)
|
|
193
|
+
return null;
|
|
194
|
+
if (!inWindow(record, nowMs))
|
|
195
|
+
return null;
|
|
196
|
+
if (currentCandidateSignature.commandHash !== record.commandHash)
|
|
197
|
+
return null; // not an evidence event
|
|
198
|
+
if (isSameProcess(currentCandidateSignature, record.targetTuple))
|
|
199
|
+
return 'wrong';
|
|
200
|
+
// Same commandHash but a different process — or same pid with un-orderable
|
|
201
|
+
// start-times (same-ness unconfirmable) → lookalike, never a counterfactual.
|
|
202
|
+
return 'unknown';
|
|
203
|
+
}
|
|
204
|
+
export function hogDecisionStorePath(stateDir) {
|
|
205
|
+
return path.join(stateDir, 'state', 'external-hog-decisions.json');
|
|
206
|
+
}
|
|
207
|
+
const HOUR_MS = 60 * 60 * 1000;
|
|
208
|
+
const VERDICTS = new Set(['kill', 'leave', 'alert', 'decider-unavailable']);
|
|
209
|
+
const ENACTED = new Set([
|
|
210
|
+
'killed', 'sigterm-exited', 'would-kill', 'deferred', 'aborted',
|
|
211
|
+
'alert-only-model-spared', 'alert-only-floor-veto', 'alert-only-breaker-held',
|
|
212
|
+
'alert-only-governor-hold', 'decider-unavailable',
|
|
213
|
+
]);
|
|
214
|
+
/** A positive-hours config value, else the inline default (never seeded into config — §5.7). */
|
|
215
|
+
function hoursOrDefault(v, defaultHours) {
|
|
216
|
+
return typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : defaultHours;
|
|
217
|
+
}
|
|
218
|
+
/** Validate one parsed record member-wise; null = malformed → dropped (fail closed per record). */
|
|
219
|
+
function coerceRecord(raw) {
|
|
220
|
+
if (!raw || typeof raw !== 'object')
|
|
221
|
+
return null;
|
|
222
|
+
const r = raw;
|
|
223
|
+
if (typeof r.verdict !== 'string' || !VERDICTS.has(r.verdict))
|
|
224
|
+
return null;
|
|
225
|
+
if (typeof r.enacted !== 'string' || !ENACTED.has(r.enacted))
|
|
226
|
+
return null;
|
|
227
|
+
if (r.correlationId !== null && typeof r.correlationId !== 'string')
|
|
228
|
+
return null;
|
|
229
|
+
if (typeof r.atMs !== 'number' || !Number.isFinite(r.atMs))
|
|
230
|
+
return null;
|
|
231
|
+
if (typeof r.floorPermitted !== 'boolean')
|
|
232
|
+
return null;
|
|
233
|
+
if (typeof r.commandHash !== 'string' || r.commandHash.length === 0)
|
|
234
|
+
return null;
|
|
235
|
+
if (typeof r.effectiveWindowMs !== 'number' || !Number.isFinite(r.effectiveWindowMs) || r.effectiveWindowMs <= 0)
|
|
236
|
+
return null;
|
|
237
|
+
const t = r.targetTuple;
|
|
238
|
+
if (!t || typeof t !== 'object' || typeof t.pid !== 'number' || !Number.isInteger(t.pid))
|
|
239
|
+
return null;
|
|
240
|
+
if (t.startTimeMs !== null && (typeof t.startTimeMs !== 'number' || !Number.isFinite(t.startTimeMs)))
|
|
241
|
+
return null;
|
|
242
|
+
const o = r.ownerTuple;
|
|
243
|
+
if (!o || typeof o !== 'object')
|
|
244
|
+
return null;
|
|
245
|
+
if (o.parentPid !== undefined && (typeof o.parentPid !== 'number' || !Number.isInteger(o.parentPid)))
|
|
246
|
+
return null;
|
|
247
|
+
if (o.parentStartTimeMs !== undefined && (typeof o.parentStartTimeMs !== 'number' || !Number.isFinite(o.parentStartTimeMs)))
|
|
248
|
+
return null;
|
|
249
|
+
if (r.reFlaggedAtMs !== undefined && (typeof r.reFlaggedAtMs !== 'number' || !Number.isFinite(r.reFlaggedAtMs)))
|
|
250
|
+
return null;
|
|
251
|
+
return {
|
|
252
|
+
verdict: r.verdict,
|
|
253
|
+
enacted: r.enacted,
|
|
254
|
+
correlationId: r.correlationId,
|
|
255
|
+
atMs: r.atMs,
|
|
256
|
+
targetTuple: { pid: t.pid, startTimeMs: t.startTimeMs },
|
|
257
|
+
ownerTuple: {
|
|
258
|
+
...(o.parentPid !== undefined ? { parentPid: o.parentPid } : {}),
|
|
259
|
+
...(o.parentStartTimeMs !== undefined ? { parentStartTimeMs: o.parentStartTimeMs } : {}),
|
|
260
|
+
},
|
|
261
|
+
floorPermitted: r.floorPermitted,
|
|
262
|
+
commandHash: r.commandHash,
|
|
263
|
+
effectiveWindowMs: r.effectiveWindowMs,
|
|
264
|
+
...(r.reFlaggedAtMs !== undefined ? { reFlaggedAtMs: r.reFlaggedAtMs } : {}),
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
export class ExternalHogDecisionStore {
|
|
268
|
+
file;
|
|
269
|
+
clock;
|
|
270
|
+
slots = new Map();
|
|
271
|
+
/** The evidence window in force (config-derived; recorded per record). */
|
|
272
|
+
evidenceWindowMs;
|
|
273
|
+
gradingSlackMs;
|
|
274
|
+
/** §5.3 derivation: max(evidenceWindowMs + gradingSlackMs, killLedgerBreakerWindowMs). */
|
|
275
|
+
retentionMs;
|
|
276
|
+
/** Seam dry-run (§5.2): suppresses the durable persist; grade-on-supersede still runs in-memory. */
|
|
277
|
+
dryRun;
|
|
278
|
+
log;
|
|
279
|
+
constructor(opts) {
|
|
280
|
+
this.file = hogDecisionStorePath(opts.stateDir);
|
|
281
|
+
this.clock = opts.nowMs ?? Date.now;
|
|
282
|
+
const quality = opts.config?.provenance?.quality;
|
|
283
|
+
this.evidenceWindowMs = hoursOrDefault(quality?.evidenceWindowHours, 6) * HOUR_MS;
|
|
284
|
+
this.gradingSlackMs = hoursOrDefault(quality?.gradingSlackHours, 2) * HOUR_MS;
|
|
285
|
+
const breakerMs = Number.isFinite(opts.killLedgerBreakerWindowMs) && opts.killLedgerBreakerWindowMs > 0
|
|
286
|
+
? opts.killLedgerBreakerWindowMs : 0;
|
|
287
|
+
this.retentionMs = Math.max(this.evidenceWindowMs + this.gradingSlackMs, breakerMs);
|
|
288
|
+
// §5.2/§5.7: dryRun defaults TRUE (the recorder's `!== false` safe default) —
|
|
289
|
+
// a store built without the flag suppresses durable writes rather than
|
|
290
|
+
// silently persisting on a dark seam.
|
|
291
|
+
this.dryRun = opts.dryRun !== false;
|
|
292
|
+
this.log = opts.log ?? (() => { });
|
|
293
|
+
this.hydrate(); // fail-closed: any anomaly → empty store
|
|
294
|
+
}
|
|
295
|
+
/** FAIL-CLOSED hydration (the ArmStore posture): missing / unreadable /
|
|
296
|
+
* corrupt / wrong-shape file → empty; a malformed record is dropped. */
|
|
297
|
+
hydrate() {
|
|
298
|
+
try {
|
|
299
|
+
if (!fs.existsSync(this.file))
|
|
300
|
+
return;
|
|
301
|
+
const parsed = JSON.parse(fs.readFileSync(this.file, 'utf-8'));
|
|
302
|
+
if (!parsed || typeof parsed !== 'object')
|
|
303
|
+
return;
|
|
304
|
+
const slots = parsed.slots;
|
|
305
|
+
if (!slots || typeof slots !== 'object' || Array.isArray(slots))
|
|
306
|
+
return;
|
|
307
|
+
for (const [key, raw] of Object.entries(slots)) {
|
|
308
|
+
if (!raw || typeof raw !== 'object')
|
|
309
|
+
continue;
|
|
310
|
+
const latest = coerceRecord(raw.latest);
|
|
311
|
+
const kill = coerceRecord(raw.kill);
|
|
312
|
+
if (!latest && !kill)
|
|
313
|
+
continue;
|
|
314
|
+
this.slots.set(key, { ...(latest ? { latest } : {}), ...(kill ? { kill } : {}) });
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
catch {
|
|
318
|
+
// @silent-fallback-ok: FAIL-CLOSED read is this store's documented contract (the
|
|
319
|
+
// ExternalHogArmStore posture, spec §5.3): a damaged decision file yields an EMPTY
|
|
320
|
+
// store — decisions then age out `unknown` (honest) rather than grading over
|
|
321
|
+
// half-parsed ground truth. Never a throw into sentinel construction.
|
|
322
|
+
this.slots.clear();
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/** The on-disk shape for the current in-memory slots (shared by persist + the dryRun would-write sizer). */
|
|
326
|
+
buildShape() {
|
|
327
|
+
const shape = { version: 1, slots: {} };
|
|
328
|
+
for (const [key, slot] of this.slots) {
|
|
329
|
+
shape.slots[key] = {
|
|
330
|
+
...(slot.latest ? { latest: slot.latest } : {}),
|
|
331
|
+
...(slot.kill ? { kill: slot.kill } : {}),
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
return shape;
|
|
335
|
+
}
|
|
336
|
+
/** Atomic + durable persist (tmp → fsync → rename, 0600) — the ArmStore write posture. */
|
|
337
|
+
persist() {
|
|
338
|
+
const dir = path.dirname(this.file);
|
|
339
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
340
|
+
const shape = this.buildShape();
|
|
341
|
+
const tmp = `${this.file}.tmp-${process.pid}`;
|
|
342
|
+
const fd = fs.openSync(tmp, 'w', 0o600);
|
|
343
|
+
try {
|
|
344
|
+
fs.writeSync(fd, JSON.stringify(shape, null, 2));
|
|
345
|
+
fs.fsyncSync(fd); // durable: content on disk before the rename publishes it
|
|
346
|
+
}
|
|
347
|
+
finally {
|
|
348
|
+
fs.closeSync(fd);
|
|
349
|
+
}
|
|
350
|
+
fs.renameSync(tmp, this.file); // atomic overwrite — a reader sees old-or-new, never partial
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* §5.2 dryRun stage: the durable persist is suppressed, so emit a METADATA-ONLY
|
|
354
|
+
* would-write line instead — ledgerKey count + serialized byte size, NEVER the
|
|
355
|
+
* record content (the same posture the recorder's would-write line keeps). The
|
|
356
|
+
* in-memory slots have already been mutated by `record()`, so this reflects what
|
|
357
|
+
* WOULD have been written.
|
|
358
|
+
*/
|
|
359
|
+
logWouldPersist() {
|
|
360
|
+
let bytes = -1;
|
|
361
|
+
try {
|
|
362
|
+
bytes = Buffer.byteLength(JSON.stringify(this.buildShape()), 'utf8');
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
// @silent-fallback-ok: byte sizing feeds a metadata-only would-write log line
|
|
366
|
+
// (the write is already suppressed); an unserializable shape reports -1 rather
|
|
367
|
+
// than throwing into the scan tick the store observes.
|
|
368
|
+
bytes = -1;
|
|
369
|
+
}
|
|
370
|
+
this.log(`[decision-quality] dryRun would-persist hog-store: ledgerKeys=${this.slots.size} bytes=${bytes}`);
|
|
371
|
+
}
|
|
372
|
+
/** Prune on write at the derived retention (per record; empty keys dropped). */
|
|
373
|
+
prune(nowMs) {
|
|
374
|
+
for (const [key, slot] of this.slots) {
|
|
375
|
+
if (slot.latest && nowMs - slot.latest.atMs > this.retentionMs)
|
|
376
|
+
delete slot.latest;
|
|
377
|
+
if (slot.kill && nowMs - slot.kill.atMs > this.retentionMs)
|
|
378
|
+
delete slot.kill;
|
|
379
|
+
if (!slot.latest && !slot.kill)
|
|
380
|
+
this.slots.delete(key);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/** The retained slots for one ledgerKey (grading/test read). */
|
|
384
|
+
get(ledgerKey) {
|
|
385
|
+
const slot = this.slots.get(ledgerKey);
|
|
386
|
+
if (!slot)
|
|
387
|
+
return undefined;
|
|
388
|
+
return { ...(slot.latest ? { latest: slot.latest } : {}), ...(slot.kill ? { kill: slot.kill } : {}) };
|
|
389
|
+
}
|
|
390
|
+
/** Every retained record with its key + slot — the P9 grading endpoint's read
|
|
391
|
+
* (window-close evaluation via evaluateHogSustainedRight over these rows). */
|
|
392
|
+
list() {
|
|
393
|
+
const out = [];
|
|
394
|
+
for (const [ledgerKey, slot] of this.slots) {
|
|
395
|
+
if (slot.latest)
|
|
396
|
+
out.push({ ledgerKey, slot: 'latest', record: slot.latest });
|
|
397
|
+
if (slot.kill && !(slot.latest && sameStoredDecision(slot.kill, slot.latest)))
|
|
398
|
+
out.push({ ledgerKey, slot: 'kill', record: slot.kill });
|
|
399
|
+
}
|
|
400
|
+
return out;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Write ONE decision (grade-on-supersede FIRST, §5.3): evaluates the positive-evidence
|
|
404
|
+
* predicates against the OUTGOING record(s) for this ledgerKey — the incoming decision IS the
|
|
405
|
+
* same-commandHash re-flag event — and returns the grade events to the caller BEFORE the slot
|
|
406
|
+
* is replaced. Also stamps the retained in-window kill slot's `reFlaggedAtMs` (destroying the
|
|
407
|
+
* window-close negative evidence honestly), applies the slot semantics (an incoming ENACTED
|
|
408
|
+
* kill takes the kill slot; a non-kill NEVER evicts it), prunes at retention, and persists
|
|
409
|
+
* atomically. Throws only on a persist failure (the caller — the sentinel shell — contains it).
|
|
410
|
+
*/
|
|
411
|
+
record(seed, scan) {
|
|
412
|
+
const nowMs = this.clock();
|
|
413
|
+
const events = [];
|
|
414
|
+
const incoming = {
|
|
415
|
+
verdict: seed.verdict,
|
|
416
|
+
enacted: seed.enacted,
|
|
417
|
+
correlationId: seed.correlationId,
|
|
418
|
+
atMs: nowMs,
|
|
419
|
+
targetTuple: seed.targetTuple,
|
|
420
|
+
ownerTuple: seed.ownerTuple,
|
|
421
|
+
floorPermitted: seed.floorPermitted,
|
|
422
|
+
commandHash: seed.commandHash,
|
|
423
|
+
effectiveWindowMs: this.evidenceWindowMs,
|
|
424
|
+
};
|
|
425
|
+
const slot = this.slots.get(seed.ledgerKey);
|
|
426
|
+
if (slot) {
|
|
427
|
+
// ── Grade-on-supersede: the OUTGOING records are graded BEFORE replacement. ──
|
|
428
|
+
if (slot.kill) {
|
|
429
|
+
const grade = evaluateHogRespawnWrong(slot.kill, scan, nowMs);
|
|
430
|
+
if (grade) {
|
|
431
|
+
events.push({
|
|
432
|
+
ruleId: HOG_RESPAWN_WRONG_RULE_ID, grade,
|
|
433
|
+
correlationId: slot.kill.correlationId, ledgerKey: seed.ledgerKey,
|
|
434
|
+
windowMs: slot.kill.effectiveWindowMs,
|
|
435
|
+
evidenceNote: `same-commandHash respawn at supersede; enacted=${slot.kill.enacted}; ordering-test=${grade === 'wrong' ? 'true' : 'false-or-unorderable'}`,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
// The supersede IS a same-key re-flag: stamp it while the kill's window is open
|
|
439
|
+
// so hog-sustained-right-v1 can never grade a re-flagged kill `right`.
|
|
440
|
+
if (inWindow(slot.kill, nowMs) && slot.kill.reFlaggedAtMs === undefined) {
|
|
441
|
+
slot.kill = { ...slot.kill, reFlaggedAtMs: nowMs };
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
// (The leave-recurrence preconditions — verdict 'leave' — make a latest-that-IS-the-kill
|
|
445
|
+
// a structural no-op here; the guard just skips the redundant evaluation.)
|
|
446
|
+
if (slot.latest && !(slot.kill && sameStoredDecision(slot.latest, slot.kill))) {
|
|
447
|
+
const grade = evaluateHogLeaveRecurrence(slot.latest, { pid: seed.targetTuple.pid, startTimeMs: seed.targetTuple.startTimeMs, commandHash: seed.commandHash }, nowMs);
|
|
448
|
+
if (grade) {
|
|
449
|
+
events.push({
|
|
450
|
+
ruleId: HOG_LEAVE_RECURRENCE_RULE_ID, grade,
|
|
451
|
+
correlationId: slot.latest.correlationId, ledgerKey: seed.ledgerKey,
|
|
452
|
+
windowMs: slot.latest.effectiveWindowMs,
|
|
453
|
+
evidenceNote: `same-commandHash re-flag at supersede; same-process=${grade === 'wrong' ? 'true' : 'false-or-unconfirmable'}`,
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// ── Replace: latest always; the kill slot ONLY for an incoming ENACTED kill
|
|
459
|
+
// (a same-key flood of non-kill decisions can never evict a kill's
|
|
460
|
+
// evidence slot before its window closes — ADV r3). ──
|
|
461
|
+
const next = this.slots.get(seed.ledgerKey) ?? {};
|
|
462
|
+
next.latest = incoming;
|
|
463
|
+
if (HOG_KILL_ENACTED.has(seed.enacted))
|
|
464
|
+
next.kill = incoming;
|
|
465
|
+
this.slots.set(seed.ledgerKey, next);
|
|
466
|
+
this.prune(nowMs);
|
|
467
|
+
// §5.2/§5.7: while dryRun holds, ALL durable writes are suppressed (spec
|
|
468
|
+
// Testing: "dry-run suppresses all durable writes") — the hog store's persist
|
|
469
|
+
// included. Grade-on-supersede already ran IN-MEMORY above, so the annotate
|
|
470
|
+
// seam's would-write soak stays complete; only the disk write is withheld
|
|
471
|
+
// until the operator flips dryRun:false.
|
|
472
|
+
if (this.dryRun) {
|
|
473
|
+
this.logWouldPersist();
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
this.persist();
|
|
477
|
+
}
|
|
478
|
+
return events;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
//# sourceMappingURL=ExternalHogDecisionStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalHogDecisionStore.js","sourceRoot":"","sources":["../../src/monitoring/ExternalHogDecisionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,MAAM,SAAS,CAA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IAAI,GAAG,QAAQ,CAAC;QAC7D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClB,yEAAyE;QACzE,8EAA8E;QAC9E,4EAA4E;QAC5E,0EAA0E;QAC1E,yCAAyC;QACzC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { type ExternalHogAdapters } from './ExternalHogSentinel.js';
|
|
16
16
|
import { type ArmMarker } from './ExternalHogArmMarker.js';
|
|
17
|
+
import type { DecisionProvenanceBlock } from '../core/decisionQualityTypes.js';
|
|
17
18
|
/** The raw side-effect primitives — the ONLY things that touch the real OS / network. */
|
|
18
19
|
export interface ExternalHogPrimitives {
|
|
19
20
|
/** Run a command off the event loop, resolve stdout. Reject/throw on non-zero exit is fine —
|
|
@@ -26,8 +27,11 @@ export interface ExternalHogPrimitives {
|
|
|
26
27
|
* is unreadable. This is the fresh "is it STILL pinning cores, or did it go idle?" probe that
|
|
27
28
|
* gates every signal — a null or below-threshold reading must abort the kill (fail-safe). */
|
|
28
29
|
cpuCoresOver(pid: number, windowMs: number): Promise<number | null>;
|
|
29
|
-
/** Call the classifier model with a prompt (wrapped by the caller in the LlmQueue background lane).
|
|
30
|
-
|
|
30
|
+
/** Call the classifier model with a prompt (wrapped by the caller in the LlmQueue background lane).
|
|
31
|
+
* `provenance` is the llm-decision-quality-meter §5.3 enrollment block — the server-side
|
|
32
|
+
* primitive threads it as `options.provenance` on intelligence.evaluate so the router mints +
|
|
33
|
+
* settles a decision row for the kill/leave verdict. */
|
|
34
|
+
callModel(prompt: string, provenance?: DecisionProvenanceBlock): Promise<string>;
|
|
31
35
|
/** Raise ONE attention item for the coalesced notices. */
|
|
32
36
|
raiseAttention(item: {
|
|
33
37
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalHogRealAdapters.d.ts","sourceRoot":"","sources":["../../src/monitoring/ExternalHogRealAdapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAKnF,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ExternalHogRealAdapters.d.ts","sourceRoot":"","sources":["../../src/monitoring/ExternalHogRealAdapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAKnF,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI5F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,yFAAyF;AACzF,MAAM,WAAW,qBAAqB;IACpC;uDACmD;IACnD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,2FAA2F;IAC3F,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,CAAC,GAAG,OAAO,CAAC;IAC7D;;;kGAG8F;IAC9F,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpE;;;6DAGyD;IACzD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAA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;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBrG;AAED,uGAAuG;AACvG,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAmBhI;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAW3D;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,sBAAsB,GAAG,mBAAmB,CAsJzH"}
|
|
@@ -165,11 +165,11 @@ export function createExternalHogAdapters(prims, opts) {
|
|
|
165
165
|
function identityFor(_candidate, facts) {
|
|
166
166
|
return buildIdentity(facts);
|
|
167
167
|
}
|
|
168
|
-
async function classify(facts) {
|
|
168
|
+
async function classify(facts, provenance) {
|
|
169
169
|
const classId = matchAllowlistClass(facts.name, facts.argv);
|
|
170
170
|
if (!classId)
|
|
171
171
|
return null; // not an allowlist class → decider-unavailable → alert (never happens: only classified after identity)
|
|
172
|
-
return prims.callModel(buildClassifierPrompt(facts, classId));
|
|
172
|
+
return prims.callModel(buildClassifierPrompt(facts, classId), provenance);
|
|
173
173
|
}
|
|
174
174
|
function currentClassContentHash(classId) {
|
|
175
175
|
const sources = classRuleSources(classId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalHogRealAdapters.js","sourceRoot":"","sources":["../../src/monitoring/ExternalHogRealAdapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,cAAc,EAAqB,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,aAAa,EAA4B,MAAM,0BAA0B,CAAC;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