agent-workflow-inspector 0.0.0-stage → 1.0.0

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 ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 — Unreleased
4
+
5
+ Initial local V1: canonical AWI JSON and OTLP subset; strict validation; SHA-256 fingerprints; six bounded rules; CLI/library; human/JSON reports; configuration; synthetic examples; security/regression/CLI tests; schemas; cross-platform CI. No npm publication or public release performed.
6
+
7
+ ### Release preparation
8
+
9
+ Added package homepage, issue tracker, keywords and optional funding metadata; clearer installation and maintainer guidance; release notes and an explicit approval-gated publication procedure. The audited commit passed all nine hosted CI jobs. Release-preparation commits require a fresh matrix before publication. No runtime behavior or dependencies changed.
10
+
11
+ ### Pre-release audit fixes
12
+
13
+ Fixed canonicalization CPU amplification, bounded ignored-path compilation/caching, missing-identity evidence handling, repeated tools hidden by interleaved model spans, nanosecond/concurrent sequence false positives, retry-storm recovery handling, partial AWI002 defaults, impossible thresholds, source-reference validation, metadata amplification, malformed OTLP coercions, blank failure evidence, fragment determinism, public-renderer injection, symlink ancestors, invalid UTF-8 and broken pipes. Packed maintainer documents are included; the isolated-consumer smoke test now checks all examples, executable mode and TypeScript declarations. CI actions are SHA-pinned with no persisted checkout credentials.
@@ -0,0 +1,5 @@
1
+ # Code of conduct
2
+
3
+ Be respectful, constructive and inclusive. Harassment, threats, discrimination, doxxing, sexual harassment and deliberate disruption are unacceptable in project spaces.
4
+
5
+ Maintainers may remove harmful contributions, warn, restrict or ban participants according to severity and recurrence. Protect affected participants and preserve confidentiality. Report conduct issues privately through a maintainer channel listed on the repository owner's profile; do not publish private details in issues. Maintainers should recuse themselves from reports about their own conduct.
@@ -0,0 +1,9 @@
1
+ # Contributing
2
+
3
+ Use supported Node and pinned pnpm. Run pnpm install --frozen-lockfile, pnpm check and pnpm format:check. Add positive/negative behavior tests for detector changes and adversarial cases for security changes. Use only synthetic credential-free fixtures.
4
+
5
+ Changes to rule IDs, fingerprint identity, schema versions or exit codes require compatibility review and changelog entries. Update documentation and regenerate schemas with pnpm schemas. Check dependency engines and pnpm audit. Never weaken tests to accept defects.
6
+
7
+ Describe the problem, resulting behavior, limitations and verification in PRs. No automated publishing occurs. Maintainer approval is required for releases and remote actions.
8
+
9
+ Read the [release procedure](docs/releasing.md) before proposing package or release-workflow changes. Contact maintainer [Jigar Prajapati](https://github.com/jigar48) through GitHub for project questions; use [Security](SECURITY.md) for sensitive reports. Do not post private traces or credentials in issues.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jigar Prajapati
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,96 @@
1
- # Temporary Holding Version
1
+ # Agent Workflow Inspector (AWI)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Local-first, deterministic diagnostics for AI agent execution traces.**
4
+
5
+ Agent Workflow Inspector is a local-first, deterministic linter for AI agent execution traces that detects suspicious retry loops, repeated tool calls, execution cycles, and resource burn. It reads versioned AWI JSON or a documented subset of OTLP JSON and produces evidence for local review or CI. Analysis requires no account, LLM, network, browser, or service. AWI sends no automatic telemetry.
6
+
7
+ Findings are heuristics, not proof of bugs or waste. Repeated polling and intentional retries can match. AWI does not infer agent intent or causal dependencies from timestamps.
8
+
9
+ ## Install and quick start
10
+
11
+ Version 1.0.0 is a release candidate and is **not yet published to npm**. Once publication is confirmed, install the exact release with:
12
+
13
+ ```sh
14
+ npm install --global agent-workflow-inspector@1.0.0
15
+ awi --help
16
+ awi --version
17
+ awi inspect trace.json --format json
18
+ ```
19
+
20
+ Create `trace.json` using the [minimal trace example](docs/getting-started.md). Until publication, use the source or tarball instructions below. Supported Node versions are **22.18+ (22.x), 24.11+ (24.x), or 26.x**.
21
+
22
+ ## Run from source
23
+
24
+ Use Node **22.18+ (22.x), 24.11+ (24.x), or 26.x** and pnpm **11.25.0**.
25
+
26
+ ```sh
27
+ pnpm install --frozen-lockfile
28
+ pnpm check
29
+ node dist/cli/index.js inspect examples/healthy/basic.json
30
+ node dist/cli/index.js inspect examples/suspicious/retries.json --format json
31
+ node dist/cli/index.js inspect examples/opentelemetry/tools.json --input-format otel
32
+ ```
33
+
34
+ The suspicious example exits 2 by default. For a local installation, run `pnpm pack --out agent-workflow-inspector-1.0.0.tgz`, then `pnpm add --global ./agent-workflow-inspector-1.0.0.tgz`. The package exposes the `awi` executable and an ESM TypeScript library.
35
+
36
+ The npm registry returned 404 for `agent-workflow-inspector` on October 19, 2026; this neither reserves the name nor guarantees future availability.
37
+
38
+ ## CLI
39
+
40
+ ```sh
41
+ awi inspect trace.json --format human
42
+ awi inspect ./traces --format json --fail-on medium --output report.json
43
+ awi inspect first.json second.json --config awi.config.example.json
44
+ ```
45
+
46
+ | Rule | Default severity | Recorded pattern |
47
+ | ------ | ---------------- | ------------------------------------------------------------------ |
48
+ | AWI001 | medium | Four equivalent tool calls in a bounded window |
49
+ | AWI002 | high | Three equivalent failing calls with matching error evidence |
50
+ | AWI003 | medium | A cycle of 2–6 calls repeating three times |
51
+ | AWI004 | high | Five rapid equivalent attempts, preceded by explicit failures |
52
+ | AWI005 | medium | More than 100 operations or parent depth over 20 |
53
+ | AWI006 | medium | Recorded leaf usage/cost directly associated with suspicious calls |
54
+
55
+ Exit codes: **0** completed below threshold; **1** invalid input/configuration, operational failure, or incomplete analysis; **2** completed with findings at or above threshold. Default threshold: high. `--fail-on none` disables finding-based failure.
56
+
57
+ Directories are recursive, bounded, deterministic, and restricted to JSON files. Symlinks and existing output paths are refused. Raw arguments, results, messages, prompts, and metadata are absent from ordinary reports. IDs remain visible for evidence; avoid putting secrets in identifiers. `--show-content` includes content with limited key-based redaction and can expose private data.
58
+
59
+ ## Library
60
+
61
+ ```ts
62
+ import { readFile } from 'node:fs/promises';
63
+ import { analyze, ingest, parseJson } from 'agent-workflow-inspector';
64
+
65
+ const traces = ingest(parseJson(await readFile('trace.json', 'utf8')));
66
+ const report = analyze(traces, { rules: { AWI001: { threshold: 5 } } });
67
+ console.log(report.findings);
68
+ ```
69
+
70
+ Library and CLI share validators, limits, detectors, and report contracts. Use ingest/analyze for resource and graph checks; exported structural schemas alone are not a security boundary. The library does no filesystem access or networking. Optional properties represent unknown values; they are never silently replaced with zero.
71
+
72
+ ## Documentation
73
+
74
+ - [Getting started](docs/getting-started.md)
75
+ - [Trace formats and OTLP mapping](docs/trace-formats.md)
76
+ - [Detection rules](docs/detection-rules.md)
77
+ - [Configuration](docs/configuration.md)
78
+ - [Architecture and dependency choices](docs/architecture.md)
79
+ - [Security](docs/security.md)
80
+ - [CI integration](docs/ci-integration.md)
81
+ - [Report contract](docs/report-schema.md)
82
+ - [Troubleshooting](docs/troubleshooting.md)
83
+ - [Limitations](docs/limitations.md)
84
+ - [Pre-release audit](docs/audit.md)
85
+ - [Verification record](docs/verification.md)
86
+ - [Contributing](CONTRIBUTING.md)
87
+ - [Release notes](docs/releases/v1.0.0.md)
88
+ - [Maintainer release procedure](docs/releasing.md)
89
+
90
+ MIT licensed. No framework-specific compatibility claims are made beyond the documented input mappings.
91
+
92
+ ## Work With Me
93
+
94
+ Maintained by [Jigar Prajapati](https://github.com/jigar48). For automation and AI tooling projects, visit my [portfolio](https://jigar48.github.io/automatewithjigar/) or connect on [LinkedIn](https://www.linkedin.com/in/buildaiwith-jigar-prajapati/).
95
+
96
+ If AWI is useful, [optional support](https://buymeacoffee.com/buildwithjigar) helps sustain maintenance. Contributions and reproducible bug reports are welcome; see [Contributing](CONTRIBUTING.md) and [Security](SECURITY.md).
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security policy
2
+
3
+ The 1.x line receives security fixes. Never post credentials, private traces or sensitive exploit details publicly. Use GitHub private vulnerability reporting if enabled, or contact the maintainer privately through their GitHub profile. If no private channel exists, open a minimal issue requesting one without sensitive details.
4
+
5
+ Provide affected version, synthetic reproduction, expected/observed behavior and impact. There is no guaranteed response SLA. Read docs/security.md for threat model, redaction limitations and resource bounds.
@@ -0,0 +1,34 @@
1
+ {
2
+ "version": 1,
3
+ "rules": {
4
+ "AWI001": {
5
+ "enabled": true,
6
+ "threshold": 4
7
+ },
8
+ "AWI002": {
9
+ "enabled": true,
10
+ "threshold": 3
11
+ },
12
+ "AWI003": {
13
+ "enabled": true,
14
+ "minRepetitions": 3,
15
+ "maxCycleLength": 6
16
+ },
17
+ "AWI004": {
18
+ "enabled": true,
19
+ "threshold": 5,
20
+ "windowSeconds": 30
21
+ },
22
+ "AWI005": {
23
+ "enabled": true,
24
+ "maxOperations": 100,
25
+ "maxDepth": 20
26
+ },
27
+ "AWI006": {
28
+ "enabled": true
29
+ }
30
+ },
31
+ "fingerprint": {
32
+ "ignorePaths": []
33
+ }
34
+ }
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node