{"_id":"@affectively/trace-lint","_rev":"5-8643bf6f27beddadb67a47994f572a24","name":"@affectively/trace-lint","dist-tags":{"latest":"5.0.0"},"versions":{"0.2.0":{"name":"@affectively/trace-lint","version":"0.2.0","keywords":["trace","lint","devtools","chrome-trace","profiling","diagnostics","typescript"],"author":{"name":"AFFECTIVELY","email":"opensource@affectively.ai"},"license":"MIT","_id":"@affectively/trace-lint@0.2.0","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"homepage":"https://github.com/affectively-ai/trace-lint#readme","bugs":{"url":"https://github.com/affectively-ai/trace-lint/issues"},"bin":{"trace-lint":"dist/cli.js"},"dist":{"shasum":"70c0cf1d9edf19dbcc52aa94e79aaf374c20c8e7","tarball":"https://registry.npmjs.org/@affectively/trace-lint/-/trace-lint-0.2.0.tgz","fileCount":56,"integrity":"sha512-wAnBKM/NjCveshZ7kEHeIHys5gyAYzTvL+CkiXFeggjv24G2qQJWuTLaBckhYQLkWmt2cXeH8VZrCtr5nYKPdQ==","signatures":[{"sig":"MEYCIQC/R50cb027oilKa9F/w9WJtynwy8zoqzCvF0s6JVs8fQIhANNaU9LHuVQfAXnfwJE7XGJ2WiTb8qzqIn058ctLasoa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":301577},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"bun":">=1.0.0","node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist-cjs/index.js"}},"gitHead":"2f98be7357de506584adff65da09384d0c102513","scripts":{"dev":"bun run src/cli.ts","run":"bun run src/cli.ts","build":"tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","run:latest":"bun run src/cli.ts --latest","type-check":"tsc -p tsconfig.json --noEmit","run:capture":"bun run src/cli.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"repository":{"url":"git+https://github.com/affectively-ai/trace-lint.git","type":"git"},"_npmVersion":"11.8.0","description":"Extensible linting framework for Chrome/DevTools trace files with loop detection rules.","directories":{},"_nodeVersion":"25.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.0","@types/node":"^22.15.29"},"_npmOperationalInternal":{"tmp":"tmp/trace-lint_0.2.0_1772300750202_0.710233807076571","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."},"0.2.1":{"name":"@affectively/trace-lint","version":"0.2.1","keywords":["trace","lint","devtools","chrome-trace","profiling","diagnostics","typescript"],"author":{"name":"AFFECTIVELY","email":"opensource@affectively.ai"},"license":"MIT","_id":"@affectively/trace-lint@0.2.1","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"homepage":"https://github.com/affectively-ai/trace-lint#readme","bugs":{"url":"https://github.com/affectively-ai/trace-lint/issues"},"bin":{"trace-lint":"dist/cli.js"},"dist":{"shasum":"133232e0536cf35f55681d8eff17e1e186fc7845","tarball":"https://registry.npmjs.org/@affectively/trace-lint/-/trace-lint-0.2.1.tgz","fileCount":56,"integrity":"sha512-VFwv/RlcrO0+yRGbLgGv+3b4zq2ow4SopNqYI2KIP9PIgayfooXUjQa8Yt2BGz3CCwC41vTXKwjIP/d+dmQsNQ==","signatures":[{"sig":"MEUCIQCRl7d/UAmbpwTPqYZswjt2NCIcCOtJSuxYJLtozhc2AAIgbGzlmzMAHNPEwSw1C4XImFEJ4mcuWbUFcuMiuUKN7M0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":301577},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"bun":">=1.0.0","node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist-cjs/index.js"}},"gitHead":"acc6cc1e7b1655473710b7e9c2a2aaccc0f22eb2","scripts":{"dev":"bun run src/cli.ts","run":"bun run src/cli.ts","build":"tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","run:latest":"bun run src/cli.ts --latest","type-check":"tsc -p tsconfig.json --noEmit","run:capture":"bun run src/cli.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"repository":{"url":"git+https://github.com/affectively-ai/trace-lint.git","type":"git"},"_npmVersion":"11.8.0","description":"Extensible linting framework for Chrome/DevTools trace files with loop detection rules.","directories":{},"_nodeVersion":"25.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.0","@types/node":"^22.15.29"},"_npmOperationalInternal":{"tmp":"tmp/trace-lint_0.2.1_1772301648903_0.8351219830886807","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."},"0.2.2":{"name":"@affectively/trace-lint","version":"0.2.2","keywords":["trace","lint","devtools","chrome-trace","profiling","diagnostics","typescript"],"author":{"name":"AFFECTIVELY","email":"opensource@affectively.ai"},"license":"UNLICENSED","_id":"@affectively/trace-lint@0.2.2","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"homepage":"https://github.com/affectively-ai/trace-lint#readme","bugs":{"url":"https://github.com/affectively-ai/trace-lint/issues"},"bin":{"trace-lint":"dist/cli.js"},"dist":{"shasum":"dca2433c873e0b57cb940bd7f4ec97233b9d5c49","tarball":"https://registry.npmjs.org/@affectively/trace-lint/-/trace-lint-0.2.2.tgz","fileCount":56,"integrity":"sha512-z8XawWiliJJpqddJQAkfrji45tyejLjzUJRsYC4PI3EAZYcGf1S6vgq+LbxmuhsMnBvRAGGSgB52f3iL32Y4LQ==","signatures":[{"sig":"MEQCIDfshMPx5qRmIHbhIg/Kjkccure31olh8iZMVZDARRhwAiAmZmd+JkZm40HwJrlky+HFJ+cxl6gkc6UaVfMpI9MgBQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":303540},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"bun":">=1.0.0","node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist-cjs/index.js"}},"gitHead":"613bd6fa905db86468f2a574ad7a80dfe0844935","scripts":{"dev":"bun run src/cli.ts","run":"bun run src/cli.ts","build":"tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","run:latest":"bun run src/cli.ts --latest","type-check":"tsc -p tsconfig.json --noEmit","run:capture":"bun run src/cli.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"repository":{"url":"git+https://github.com/affectively-ai/trace-lint.git","type":"git"},"_npmVersion":"11.8.0","description":"Extensible linting framework for Chrome/DevTools trace files with loop detection rules.","directories":{},"_nodeVersion":"25.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.0","@types/node":"^22.15.29"},"_npmOperationalInternal":{"tmp":"tmp/trace-lint_0.2.2_1772306575902_0.7058497819982905","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."},"5.0.0":{"name":"@affectively/trace-lint","version":"5.0.0","keywords":["trace","lint","devtools","chrome-trace","profiling","diagnostics","typescript"],"author":{"name":"AFFECTIVELY","email":"opensource@affectively.ai"},"license":"UNLICENSED","_id":"@affectively/trace-lint@5.0.0","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"homepage":"https://github.com/affectively-ai/trace-lint#readme","bugs":{"url":"https://github.com/affectively-ai/trace-lint/issues"},"bin":{"trace-lint":"dist/cli.js"},"dist":{"shasum":"674787196d1e5524cd9be1dc885e204001460e4d","tarball":"https://registry.npmjs.org/@affectively/trace-lint/-/trace-lint-5.0.0.tgz","fileCount":62,"integrity":"sha512-wi2q3cXMSeIRno3FjDB7smbTzVKKvET1sLsSEOeZyjrH2/dczqIDFfF4aj0LgXV7tR0qhS9P1cMe4xk6DtwxOw==","signatures":[{"sig":"MEUCIQDIROqToOmkQmuXWsXD3Non1kMJXENA+Jp1p8y7DJn75QIge60TaxqKONm5WrSKpYpo6Tn3s2nCj+Apxfjtg09+660=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":311871},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"bun":">=1.0.0","node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist-cjs/index.js"}},"gitHead":"ae54b0df6ac98ed86b037accafa16cf218dda541","scripts":{"dev":"bun run src/cli.ts","run":"bun run src/cli.ts","build":"tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","run:latest":"bun run src/cli.ts --latest","type-check":"tsc -p tsconfig.json --noEmit","run:capture":"bun run src/cli.ts","prepublishOnly":"bun run build"},"_npmUser":{"name":"buley","email":"buley@outlook.com"},"repository":{"url":"git+https://github.com/affectively-ai/trace-lint.git","type":"git"},"_npmVersion":"11.8.0","description":"Extensible linting framework for Chrome/DevTools trace files with loop detection rules.","directories":{},"_nodeVersion":"25.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.0","@types/node":"^22.15.29"},"_npmOperationalInternal":{"tmp":"tmp/trace-lint_5.0.0_1773156280321_0.756938594576813","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package is deprecated and no longer supported. Do not use."}},"time":{"created":"2026-02-28T17:45:50.083Z","modified":"2026-03-27T20:03:48.779Z","0.2.0":"2026-02-28T17:45:50.370Z","0.2.1":"2026-02-28T18:00:49.076Z","0.2.2":"2026-02-28T19:22:56.068Z","5.0.0":"2026-03-10T15:24:40.465Z"},"bugs":{"url":"https://github.com/affectively-ai/trace-lint/issues"},"author":{"name":"AFFECTIVELY","email":"opensource@affectively.ai"},"license":"UNLICENSED","homepage":"https://github.com/affectively-ai/trace-lint#readme","keywords":["trace","lint","devtools","chrome-trace","profiling","diagnostics","typescript"],"repository":{"url":"git+https://github.com/affectively-ai/trace-lint.git","type":"git"},"description":"Extensible linting framework for Chrome/DevTools trace files with loop detection rules.","maintainers":[{"name":"buley","email":"buley@outlook.com"}],"readme":"# @affectively/trace-lint\n\n[Parent README](../README.md) | [Source README](./src/README.md)\n\nExtensible linting framework for Chrome/DevTools trace files (`.json` and `.json.gz`).\n\nIt is designed for repeated runtime diagnostics and CI gating with a three-layer governance model:\n\n- `constraint`: non-negotiable failures (system truths).\n- `boundary`: team-held discipline and runtime guardrails.\n- `expectation`: directional pressure and optimization goals.\n\n## Installation\n\n```bash\nnpm install @affectively/trace-lint\n# or\nbun add @affectively/trace-lint\n```\n\n## CLI Usage\n\n```bash\ntrace-lint ./Trace-20260226T221208.json.gz\n```\n\nLint the newest trace in `~/Downloads` automatically:\n\n```bash\ntrace-lint --latest\n```\n\nLint the newest trace from a specific directory:\n\n```bash\ntrace-lint --latest --trace-dir ~/Downloads\n```\n\nCapture a new trace from a URL for a fixed window, then lint it:\n\n```bash\ntrace-lint --capture-url https://example.com --capture-seconds 10\n```\n\nCapture to a specific folder as plain `.json` (no gzip):\n\n```bash\ntrace-lint --capture-url https://example.com --capture-seconds 8 --capture-dir ~/Downloads --capture-json\n```\n\nFilter to one rule and fail CI on warnings:\n\n```bash\ntrace-lint ./trace.json.gz \\\n  --rule repeated-async-task-loop \\\n  --fail-on warn\n```\n\nJSON output:\n\n```bash\ntrace-lint ./trace.json.gz --json > trace-lint-report.json\n```\n\nAgent-mitigation JSON output (includes objective/actions/verification per finding):\n\n```bash\ntrace-lint ./trace.json.gz --json --detail-mode agent > trace-lint-agent-report.json\n```\n\nForensics output for deeper automation/debugging:\n\n```bash\ntrace-lint ./trace.json.gz --json --detail-mode forensics > trace-lint-forensics.json\n```\n\nRun through the repo script:\n\n```bash\nbun run trace:lint ./trace.json.gz --fail-on warn\n```\n\nLatest-trace script shortcut:\n\n```bash\nbun run trace:lint:latest --fail-on warn\n```\n\nCapture-and-lint script shortcut:\n\n```bash\nbun run trace:lint:capture --capture-url https://example.com --capture-seconds 10 --fail-on warn\n```\n\nNx target equivalents:\n\n```bash\nbun nx run trace-lint:run -- ./trace.json.gz --fail-on warn\nbun nx run trace-lint:latest -- --fail-on warn\nbun nx run trace-lint:capture -- --capture-url https://example.com --capture-seconds 10 --fail-on warn\n```\n\nJank-focused run with strict dropped-frame policy:\n\n```bash\ntrace-lint ./trace.json.gz \\\n  --allowed-dropped-frames 0 \\\n  --frame-budget-ms 16.7 \\\n  --max-frame-overrun-ratio 0.03 \\\n  --long-task-threshold-ms 50 \\\n  --max-main-thread-long-tasks 0 \\\n  --fail-on warn\n```\n\n## API Usage\n\n```ts\nimport { loadTraceFile, runTraceLint, defaultTraceLintRules } from '@affectively/trace-lint';\nimport type { TraceLintRule } from '@affectively/trace-lint';\n\nconst customRule: TraceLintRule = {\n  id: 'my-custom-rule',\n  layer: 'expectation',\n  description: 'Example custom rule',\n  defaultSeverity: 'info',\n  check: ({ stats }) => {\n    const timerFires = stats.eventNameCounts.get('TimerFire') ?? 0;\n    if (timerFires < 200) return [];\n    return [\n      {\n        ruleId: 'my-custom-rule',\n        layer: 'expectation',\n        severity: 'info',\n        message: `High TimerFire activity: ${timerFires}`,\n      },\n    ];\n  },\n};\n\nconst trace = loadTraceFile('./trace.json.gz');\nconst composed = runTraceLint(trace, undefined, [\n  ...defaultTraceLintRules,\n  customRule,\n]);\nconsole.log(composed.findings.length);\n```\n\n## Built-In Rules\n\n- `no-dropped-frames` (`constraint`) - fails when dropped frames exceed allowed threshold.\n- `frame-budget-jank` (`boundary`) - checks BeginFrame cadence overrun ratio.\n- `main-thread-long-task-jank` (`boundary`) - checks long `RunTask` volume on renderer main.\n- `renderer-main-boundary-bleed` (`boundary`) - flags heavy parse/layout/script work on renderer main.\n- `parse-compile-budget` (`expectation`) - tracks total parse+compile cost against budget.\n- `repeated-async-task-loop` (`boundary`) - recurring async schedule loops.\n- `repeated-resource-request-loop` (`expectation`) - stable request polling loops.\n- `timer-fire-loop` (`boundary`) - regular timer cadence loops.\n\n## CI Integration\n\nThis repository includes a reusable workflow at:\n\n- [`/.github/workflows/trace-lint.yml`](../../.github/workflows/trace-lint.yml)\n\nIt supports `workflow_call`, manual dispatch, and PR-triggered linting for trace-like files.\n\n## Development\n\n```bash\ncd open-source/trace-lint\nbun run type-check\nbun run build\n```\n","readmeFilename":"README.md"}