From c04612560c6221c337b97fed248568ad6062b060 Mon Sep 17 00:00:00 2001
From: Andrey Rychkov
@@ -198,14 +215,52 @@ CLI options
--output new-file--strict-h, --helpExit codes
+
+
0 · Success--strict, both complete and
+ partial scans succeed. Check the JSON completeness field when the distinction matters.
+ 1 · Command failed--output file may be from an earlier run.
+ 2 · Strict scan produced a partial report--output. Inspect its diagnostics before
+ using the results. A complete scan with --strict exits with 0.
+ Project selection
node dist/cli.js . --project tsconfig.build.json --exclude '**/generated/**' --test 'qa/**'Consuming the 0.x API
the selected file or invocation root and target, or null for an unreached ID. Select the ID with usages. Each
non-root node carries the edge kind and source location. summary, usageText and markdown render display text.
+ Use --format json for scripts. The packaged JSON Schema lists
+ the required properties, types, allowed values and nullable fields for each report. Summary, Markdown,
+ diagnostic messages and limitation text are for display. --changed-since produces a text summary.
+
schemaVersion === 1 for the layout above. Save the full inventory to run new
+ usages or reachability queries later. Use analyzer.version and
+ analyzer.compilerVersion to identify the producer.
+ schemaVersion === 1 and read usage.symbol,
+ usage.references and usage.counts. The CLI puts snapshot-wide diagnostics
+ alongside usage.
+ schemaVersion. Validate it against the schema’s
+ entryReport definition. File roots appear in entries. The optional
+ entrySymbols lists explicitly invoked declarations. Use reached to reconstruct
+ paths and declarations to look up reachability status.
+
+ All three shapes carry snapshotId, completeness and diagnostics. Keep
+ the matching inventory or its producer metadata with a saved query. Treat IDs as opaque and join records only
+ within the same snapshot. A fresh scan with an improved resolver can produce different IDs, counts, paths or
+ diagnostics for the same source.
+
+ Within schema version 1, readers can rely on required fields and their documented meanings. Producers may add
+ optional fields and diagnostic codes. Ignore unfamiliar properties, handle unfamiliar codes, and allow
+ optional fields such as files[].project to be absent. A required field with a nullable type, such
+ as references[].callerId, is present even when its value is null.
+
- The JSON Schema describes all three CLI report shapes. For persisted data - check schemaVersion before reading a full inventory or symbol response. The entry response has the - Reachability shape in the shipped TypeScript declarations. In 0.1.0 it has no schemaVersion. Keep analyzer and - compiler versions from the full snapshot alongside query results. Use snapshot-local IDs for joins. Accept - additional fields and unknown diagnostic codes. Compare counts across upgrades against source examples; - changes in resolution can change a result even when its shape stays compatible. Keep the generating version - for older snapshots. During 0.x the format and API can change. + During 0.x, a change that invalidates existing reports or breaks a reader following these rules belongs in a + new minor release with migration instructions. An incompatible JSON shape also needs a new schema version, + including an explicit version on a replacement for the unversioned entry report. A change to the documented + exit codes is likewise a breaking CLI change. Before moving to another minor release, validate a saved report + with the target schema and replay a representative query. For an unsupported version, retain the original + report and use its generating release until you migrate.
TS-prefixed codes are compiler diagnostics. unresolved-module and dynamic-module identify missing module