agent-inspect 6.31.34 → 6.31.35

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.31.35
4
+
5
+ ### Patch Changes
6
+
7
+ - 3cb8284: Bound and order tool-name diagnostics: cap codepoint annotations, skip pure non-Latin noise, keep bidi/control visible, and sort allowlist causes ahead of missing-tool consequences across rules (#522 follow-up). Add recipe-local refund ceiling/entity/approval (#527) and illustrative RETRIEVER→LLM OpenInference order examples via TraceCheckRule extension.
8
+
3
9
  ## 6.31.34
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -213,7 +213,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
213
213
 
214
214
  ## Status and documentation
215
215
 
216
- **Current published baseline:** **6.31.34** · persisted schema `1.0` · Node.js `>=20` · MIT.
216
+ **Current published baseline:** **6.31.35** · persisted schema `1.0` · Node.js `>=20` · MIT.
217
217
 
218
218
  Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
219
219
 
@@ -98,4 +98,26 @@ Visual demos: [SCREENSHOTS.md](./SCREENSHOTS.md) · [CLI.md](./CLI.md)
98
98
 
99
99
  - Designed for **developer machines** and **inner-loop debugging**, not petabyte log warehouses.
100
100
 
101
+ ## Trust boundary (four independent questions)
102
+
103
+ AgentInspect answers local evidence questions. Treat these as **separate**:
104
+
105
+ 1. **Capture / coverage** — What events were recorded under the declared instrumentation boundary? Missing spans, uninstrumented SDK calls, and effects outside that boundary are not inventable from silence.
106
+ 2. **Trajectory contract** — Did a TraceContract / check preset pass on the selected run(s)? Pass/fail is rule evaluation over captured evidence, not proof of business correctness.
107
+ 3. **Residual artifact safety** — Do written share/strict artifacts pass the residual safety policy (`verify-safe` / Evidence assessment)? This is best-effort local policy, not a compliance certification or whole-org DLP guarantee.
108
+ 4. **Independent authorization / effect / origin** — Is there separate evidence of lawful authority, successful side effect, and trusted producer origin? AgentInspect does not supply those by default.
109
+
110
+ Implications:
111
+
112
+ - A recomputed **unsigned** Evidence manifest can verify **internal consistency** (listed files + hashes). It does **not** prove authenticity or producer identity.
113
+ - A **signature** (if supplied externally) can authenticate bytes to a trusted signer. It still does **not** prove completeness, lawful authority, successful business effect, or absence of an uninstrumented side effect.
114
+ - A recorded **approval-before-action** event is evidence that an approval was *recorded*. It is **not** proof that the approver had authority.
115
+ - Signed receipts or durable journals (parked designs) do **not** create exactly-once side effects.
116
+
117
+ Hypothetical approval evidence fields for a future recipe (not a shipped schema): distinct `decisionId`, `policyVersion`, `actorAuthorityRef`, `actionDigest`, `targetScope`, `decisionTime`, `executionId`, and a downstream `receiptId`. These are a proposed evidence set for discussion, not a banking integration.
118
+
119
+ Parked larger designs (coverage registry, cross-run linkage, durable intent journal, signing/sealing, general value comparisons, data-flow causal explanations) stay out of incidental patches — see [implementation/active/PARKED-DESIGNS.md](./implementation/active/PARKED-DESIGNS.md).
120
+
121
+ Related: [EVIDENCE-FORMAT.md](./EVIDENCE-FORMAT.md), [ADR-0012](./decisions/ADR-0012-evidence-contract-binding.md), [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md), [NETWORK-BEHAVIOR.md](./NETWORK-BEHAVIOR.md), [NO-EGRESS-POLICY.md](./NO-EGRESS-POLICY.md).
122
+
101
123
  For roadmap intent, see [ROADMAP.md](../ROADMAP.md) (direction only — not a delivery guarantee).
@@ -4,7 +4,7 @@
4
4
 
5
5
  AgentInspect traces, log-ingest outputs, and exports are local files. They may still contain sensitive metadata that you attached manually, collected from logs, or included through optional preview settings. Use this checklist before sharing an artifact in a GitHub issue, Discussion, PR, support thread, or public post.
6
6
 
7
- This guide is practical sharing guidance, not a guarantee that any artifact is safe to publish. Redaction profiles are **best-effort transformation**, not compliance-grade DLP or a safety certification. Always finish with `verify-safe` before sharing.
7
+ This guide is practical sharing guidance, not a guarantee that any artifact is safe to publish. Redaction profiles are **best-effort transformation**, not compliance-grade DLP or a safety certification. Always finish with `verify-safe` before sharing. Passing residual safety is still only one of the [four trust-boundary questions](./LIMITATIONS.md#trust-boundary-four-independent-questions) — it does not prove capture completeness, contract truth, or independent authorization.
8
8
 
9
9
  Built-in profiles redact high-confidence credential forms (provider keys, JWTs, bearer tokens, and bounded `token=` / `api_key=` / `internal_token=` style key/value secrets). Broad or context-sensitive findings—such as private filesystem paths—may still appear under `verify-safe` and as residual status after `redact`. Org-specific patterns can use a local CLI `--policy` JSON file (`extraKeys` plus bounded literal/prefix patterns; no user regex) or programmatic custom detectors.
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.31.34",
3
+ "version": "6.31.35",
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",
@@ -8011,11 +8011,27 @@ function eventTimestamp(finding, eventById) {
8011
8011
  const eventId = finding.evidence[0]?.eventId;
8012
8012
  return eventId ? eventById.get(eventId)?.timestamp ?? "" : "";
8013
8013
  }
8014
+ function isObservedToolPolicyFinding(finding) {
8015
+ return finding.ruleId === "tool.usage" && finding.evidence[0]?.eventId !== void 0;
8016
+ }
8017
+ function isMissingToolConsequenceFinding(finding) {
8018
+ if (finding.evidence[0]?.eventId !== void 0) return false;
8019
+ if (finding.ruleId === "tool.usage" && /did not appear/.test(finding.message)) {
8020
+ return true;
8021
+ }
8022
+ return finding.ruleId.startsWith("contract.tool.arguments") && /^No finished tool named /.test(finding.message);
8023
+ }
8014
8024
  function compareFindings(eventById) {
8015
8025
  return (a, b) => {
8016
8026
  if (SEVERITY_RANK[a.severity] !== SEVERITY_RANK[b.severity]) {
8017
8027
  return SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity];
8018
8028
  }
8029
+ const aPolicy = isObservedToolPolicyFinding(a);
8030
+ const bPolicy = isObservedToolPolicyFinding(b);
8031
+ const aMissing = isMissingToolConsequenceFinding(a);
8032
+ const bMissing = isMissingToolConsequenceFinding(b);
8033
+ if (aPolicy && bMissing) return -1;
8034
+ if (bPolicy && aMissing) return 1;
8019
8035
  const byRule = a.ruleId.localeCompare(b.ruleId);
8020
8036
  if (byRule !== 0) return byRule;
8021
8037
  if (STATUS_RANK[a.status] !== STATUS_RANK[b.status]) {
@@ -8151,20 +8167,43 @@ function failFinding(ruleId, message, evidence, expected, actual, meta) {
8151
8167
  function toolName(event) {
8152
8168
  return resolveCanonicalToolName(event);
8153
8169
  }
8170
+ var MAX_TOOL_NAME_CODEPOINT_DETAILS = 3;
8171
+ function isAsciiLetterCodePoint(codePoint) {
8172
+ return codePoint >= 65 && codePoint <= 90 || codePoint >= 97 && codePoint <= 122;
8173
+ }
8174
+ function isRiskyToolNameCodePoint(codePoint) {
8175
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) return true;
8176
+ return codePoint === 1564 || codePoint === 8203 || codePoint === 8204 || codePoint === 8205 || codePoint === 8206 || codePoint === 8207 || codePoint >= 8234 && codePoint <= 8238 || codePoint >= 8294 && codePoint <= 8297 || codePoint === 65279;
8177
+ }
8178
+ function formatCodePointDetail(codePoint, index) {
8179
+ return `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")} at index ${index}`;
8180
+ }
8154
8181
  function formatToolNameForMessage(name) {
8182
+ let hasAsciiLetter = false;
8183
+ let hasNonAscii = false;
8184
+ let hasRisky = false;
8155
8185
  const details = [];
8156
8186
  for (let index = 0; index < name.length; ) {
8157
8187
  const codePoint = name.codePointAt(index);
8158
8188
  const width = codePoint > 65535 ? 2 : 1;
8189
+ if (isAsciiLetterCodePoint(codePoint)) hasAsciiLetter = true;
8190
+ const risky = isRiskyToolNameCodePoint(codePoint);
8191
+ if (risky) hasRisky = true;
8159
8192
  if (codePoint > 127) {
8160
- details.push(
8161
- `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")} at index ${index}`
8162
- );
8193
+ hasNonAscii = true;
8194
+ details.push(formatCodePointDetail(codePoint, index));
8195
+ } else if (risky) {
8196
+ details.push(formatCodePointDetail(codePoint, index));
8163
8197
  }
8164
8198
  index += width;
8165
8199
  }
8166
- if (details.length === 0) return name;
8167
- return `"${name}" (contains ${details.join("; ")})`;
8200
+ if (!hasRisky && !(hasAsciiLetter && hasNonAscii) || details.length === 0) {
8201
+ return name;
8202
+ }
8203
+ const shown = details.slice(0, MAX_TOOL_NAME_CODEPOINT_DETAILS);
8204
+ const remaining = details.length - shown.length;
8205
+ const detailText = remaining > 0 ? `${shown.join("; ")}; and ${remaining} more` : shown.join("; ");
8206
+ return `"${name}" (contains ${detailText})`;
8168
8207
  }
8169
8208
  function describeRunningEvent(event) {
8170
8209
  if (event.kind === "TOOL") {
@@ -16186,5 +16225,5 @@ function renderGateReport(result, options = {}) {
16186
16225
  }
16187
16226
 
16188
16227
  export { ATTRIBUTION_CONFIDENCES, COHORT_METRIC_IDS, DEFAULT_REDACT_KEYS, DEFAULT_SUITE_ARTIFACTS_DIR, DELIVERY_CONFLICT_ATTR, DELIVERY_EVENT_BASE_ATTR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, IDENTITY_CONFLICT_ATTR, 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, defineTraceContract, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, evaluateTraceContract, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isAttributionConfidence, isCredentialSensitiveKey, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToRunTrees, 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, stringContainsHighConfidenceCredential, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
16189
- //# sourceMappingURL=chunk-6TXW53UR.mjs.map
16190
- //# sourceMappingURL=chunk-6TXW53UR.mjs.map
16228
+ //# sourceMappingURL=chunk-RLFYFWIZ.mjs.map
16229
+ //# sourceMappingURL=chunk-RLFYFWIZ.mjs.map