agent-inspect 6.29.5 → 6.29.6
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/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/docs/CLI.md +1 -1
- package/docs/TRACE-CONTRACTS.md +10 -7
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-XWQEHKGB.mjs → chunk-DBRMI7TC.mjs} +35 -3
- package/packages/cli/dist/chunk-DBRMI7TC.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +36 -4
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +6 -6
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-XNC4EUN3.mjs → src-6CET2GW2.mjs} +3 -3
- package/packages/cli/dist/{src-XNC4EUN3.mjs.map → src-6CET2GW2.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +19 -1
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +2 -2
- package/packages/core/dist/advanced.d.ts +2 -2
- package/packages/core/dist/advanced.mjs +2 -2
- package/packages/core/dist/checks.cjs +33 -1
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +2 -2
- package/packages/core/dist/checks.d.ts +2 -2
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-TU47EKKS.mjs → chunk-OOX25GTH.mjs} +35 -3
- package/packages/core/dist/chunk-OOX25GTH.mjs.map +1 -0
- package/packages/core/dist/{index-DvSbXNot.d.ts → index-7hG_qggp.d.ts} +5 -0
- package/packages/core/dist/{index-DKv7esIo.d.cts → index-CQJUNPPe.d.cts} +5 -0
- package/packages/cli/dist/chunk-XWQEHKGB.mjs.map +0 -1
- package/packages/core/dist/chunk-TU47EKKS.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.29.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 129f45a: Safe sharing and integration clarity for 6.29.6:
|
|
8
|
+
|
|
9
|
+
- Treat fully redacted raw-content fields as share-safe while retaining other safety checks (N-8).
|
|
10
|
+
- Clarify trajectory vs outcome CI gates and TOOL-only `requiredOrder` diagnostics in CLI help/docs.
|
|
11
|
+
- Recipe corrections: pairwise measured stage commitments for comparable-cohort-runs; browser observed-outcome identity/precondition/postcondition matrix.
|
|
12
|
+
- Jest reporter association remains explicit (`associations` / `resolveTrace`); private hotel capture (N-9) stays unverified without application checkouts.
|
|
13
|
+
|
|
3
14
|
## 6.29.5
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -212,7 +212,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
|
|
|
212
212
|
|
|
213
213
|
## Status and documentation
|
|
214
214
|
|
|
215
|
-
**Current published baseline:** **6.29.
|
|
215
|
+
**Current published baseline:** **6.29.6** · persisted schema `1.0` · Node.js `>=20` · MIT.
|
|
216
216
|
|
|
217
217
|
Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
|
|
218
218
|
|
package/docs/CLI.md
CHANGED
|
@@ -337,7 +337,7 @@ Options:
|
|
|
337
337
|
- `--correlate-group`: when using `--session`, also match synthetic `group:` session keys
|
|
338
338
|
- `--guardrails <rule>`: optional deterministic guardrail rules (`banned-phrase`, `pii-leak`, `prompt-injection`, …); repeatable
|
|
339
339
|
- `--circuit <rule>`: optional circuit analyzers (`same-tool-repetition`, `max-retries`, …); repeatable
|
|
340
|
-
- `--fail-on-observation <status>`:
|
|
340
|
+
- `--fail-on-observation <status>`: **outcome gate** — adds `outcome.status` with `requireAny=true` (needs ≥1 OUTCOME event). Comma-separated statuses: `failed`, `passed`, `unknown`, `skipped`. Does **not** invent a passed outcome from tool/LLM/run success. For adapter structure without outcomes, use `--preset trajectory` (plus `--required-tool` etc.); a trajectory pass is not share safety (`verify-safe`).
|
|
341
341
|
- `--preset <trajectory|safety|comprehensive|behavioral-session>`: additive check preset (does not change the default when omitted)
|
|
342
342
|
- `behavioral-session` (6.26): require harness completion + score OUTCOME events (`--fail-on-observation failed` by default); does **not** treat every TOOL `error` as a failed run
|
|
343
343
|
- `trajectory`: completion/structure/relationship focus; excludes share-safety findings
|
package/docs/TRACE-CONTRACTS.md
CHANGED
|
@@ -25,6 +25,8 @@ Contracts compile to deterministic check rules for common cases:
|
|
|
25
25
|
|
|
26
26
|
## `tools.requiredOrder` semantics
|
|
27
27
|
|
|
28
|
+
`requiredOrder` / `orderRules` match **TOOL** events only (via canonical tool names). LLM / LOGIC / other kinds with the same display name do not satisfy the order and are not relabeled as tools. When a required name exists only under another kind, `tool.usage` reports that kind in the finding message.
|
|
29
|
+
|
|
28
30
|
`requiredOrder` is expanded into **adjacent pair** ordering rules with unique ids:
|
|
29
31
|
|
|
30
32
|
```text
|
|
@@ -42,15 +44,16 @@ Contracts compile to deterministic check rules for common cases:
|
|
|
42
44
|
- `all-occurrences` requires every `before` occurrence to finish before every `after` occurrence starts (`max(before.end) <= min(after.start)`);
|
|
43
45
|
- causal modes fail when a required interval boundary cannot be resolved instead of falling back to encounter order.
|
|
44
46
|
|
|
45
|
-
Examples for `requiredOrder: ["
|
|
47
|
+
Examples for `requiredOrder: ["retrieve_policy", "send_email"]` (both TOOL-typed):
|
|
46
48
|
|
|
47
49
|
| Trajectory | Result |
|
|
48
50
|
| --- | --- |
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `cache_lookup →
|
|
51
|
+
| `retrieve_policy → send_email` | PASS |
|
|
52
|
+
| `retrieve_policy → rerank_docs → send_email` | PASS |
|
|
53
|
+
| `retrieve_policy → send_email → retrieve_policy` | PASS under omitted / `first-occurrence`; FAIL under `all-occurrences` |
|
|
54
|
+
| `send_email → retrieve_policy` | FAIL (order) |
|
|
55
|
+
| `cache_lookup → send_email` | FAIL (missing `retrieve_policy` via implied presence) |
|
|
56
|
+
| LLM named `generate` present, no TOOL `generate` | FAIL presence with non-TOOL kind diagnostic; not treated as a tool |
|
|
54
57
|
|
|
55
58
|
Low-level `createToolOrderingRule({ before, after })` alone may still pass when an endpoint is missing (compositional). TraceContract `requiredOrder` does not.
|
|
56
59
|
|
|
@@ -111,7 +114,7 @@ defineTraceContract({
|
|
|
111
114
|
{
|
|
112
115
|
id: "retrieve",
|
|
113
116
|
contract: {
|
|
114
|
-
tools: { required: ["
|
|
117
|
+
tools: { required: ["retrieve_policy"], requiredOrder: ["retrieve_policy", "send_email"] },
|
|
115
118
|
observations: { required: ["retrieval-context-valid"] },
|
|
116
119
|
},
|
|
117
120
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "6.29.
|
|
3
|
+
"version": "6.29.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local evidence debugger and trajectory-test toolkit for TypeScript AI agents — execution trees, TraceContract checks, Evidence v2, and read-only MCP",
|
|
@@ -5674,6 +5674,18 @@ function limitFindings(findings, maxFindings) {
|
|
|
5674
5674
|
function hasRedactionMarker(value, markers) {
|
|
5675
5675
|
return markers.some((marker) => value.includes(marker)) || /^\[HASH:[A-Za-z0-9_-]+\]$/.test(value);
|
|
5676
5676
|
}
|
|
5677
|
+
function isFullyRedactedValue(value, markers = ["[REDACTED]", "[REDACTED:"]) {
|
|
5678
|
+
if (typeof value !== "string") return false;
|
|
5679
|
+
const trimmed = value.trim();
|
|
5680
|
+
if (trimmed.length === 0) return false;
|
|
5681
|
+
if (/^\[HASH:[A-Za-z0-9_-]+\]$/.test(trimmed)) return true;
|
|
5682
|
+
if (/^\[REDACTED:[^\]]*\]$/.test(trimmed)) return true;
|
|
5683
|
+
for (const marker of markers) {
|
|
5684
|
+
if (marker.endsWith(":")) continue;
|
|
5685
|
+
if (trimmed === marker) return true;
|
|
5686
|
+
}
|
|
5687
|
+
return false;
|
|
5688
|
+
}
|
|
5677
5689
|
function isSensitiveKey(key, sensitiveKeys) {
|
|
5678
5690
|
return isCredentialSensitiveKey(key, sensitiveKeys);
|
|
5679
5691
|
}
|
|
@@ -5992,8 +6004,26 @@ function createToolUsageRule(options) {
|
|
|
5992
6004
|
const findings = [];
|
|
5993
6005
|
for (const required of options.required ?? []) {
|
|
5994
6006
|
if (!nameSet.has(required)) {
|
|
6007
|
+
const otherKinds = [
|
|
6008
|
+
...new Set(
|
|
6009
|
+
context.events.filter((event) => {
|
|
6010
|
+
const kind = typeof event.kind === "string" ? event.kind.toUpperCase() : "";
|
|
6011
|
+
if (kind === "TOOL") return false;
|
|
6012
|
+
return resolveCanonicalToolName(event) === required || event.name === required || event.name === `tool:${required}` || event.name.endsWith(`:${required}`);
|
|
6013
|
+
}).map(
|
|
6014
|
+
(event) => typeof event.kind === "string" ? event.kind.toUpperCase() : "UNKNOWN"
|
|
6015
|
+
)
|
|
6016
|
+
)
|
|
6017
|
+
].sort();
|
|
6018
|
+
const hint = otherKinds.length > 0 ? ` Required name appears under non-TOOL kind(s): ${otherKinds.join(", ")}. tools.required / requiredOrder match TOOL events only.` : "";
|
|
5995
6019
|
findings.push(
|
|
5996
|
-
failFinding(
|
|
6020
|
+
failFinding(
|
|
6021
|
+
"tool.usage",
|
|
6022
|
+
`Required tool ${required} did not appear.${hint}`,
|
|
6023
|
+
runEvidence(context.selectedRun),
|
|
6024
|
+
required,
|
|
6025
|
+
names
|
|
6026
|
+
)
|
|
5997
6027
|
);
|
|
5998
6028
|
}
|
|
5999
6029
|
}
|
|
@@ -6358,6 +6388,7 @@ function createSafetyRedactionRule(options = {}) {
|
|
|
6358
6388
|
function createSafetyRawContentRule(options = {}) {
|
|
6359
6389
|
const forbiddenKeys = options.forbiddenKeys ?? DEFAULT_RAW_CONTENT_KEYS;
|
|
6360
6390
|
const safePathPrefixes = options.safePathPrefixes ?? DEFAULT_SAFE_RAW_CONTENT_PATH_PREFIXES;
|
|
6391
|
+
const markers = options.redactedMarkers ?? ["[REDACTED]", "[REDACTED:"];
|
|
6361
6392
|
return {
|
|
6362
6393
|
id: "safety.rawPrompt",
|
|
6363
6394
|
category: "safety",
|
|
@@ -6368,6 +6399,7 @@ function createSafetyRawContentRule(options = {}) {
|
|
|
6368
6399
|
for (const entry of eventValueEntries(event, { includeSummaries: options.includeSummaries })) {
|
|
6369
6400
|
const key = entry.key ?? lastPathSegment(entry.path);
|
|
6370
6401
|
if (!isRawContentPath(entry.path, key, forbiddenKeys, safePathPrefixes)) continue;
|
|
6402
|
+
if (isFullyRedactedValue(entry.value, markers)) continue;
|
|
6371
6403
|
findings.push(
|
|
6372
6404
|
failFinding(
|
|
6373
6405
|
"safety.rawPrompt",
|
|
@@ -12501,5 +12533,5 @@ function renderGateReport(result, options = {}) {
|
|
|
12501
12533
|
}
|
|
12502
12534
|
|
|
12503
12535
|
export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, Redactor, TraceDirectory, TraceReadError, TreeBuilder, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceHtmlShell, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isAttributionConfidence, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, projectLogicalEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunDiff, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, sanitizeBundleRunId, searchTraces, serializeEvidenceManifest, sha256Hex, stableJson, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
|
|
12504
|
-
//# sourceMappingURL=chunk-
|
|
12505
|
-
//# sourceMappingURL=chunk-
|
|
12536
|
+
//# sourceMappingURL=chunk-DBRMI7TC.mjs.map
|
|
12537
|
+
//# sourceMappingURL=chunk-DBRMI7TC.mjs.map
|