Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
9087e79
Bump version to 0.6.0
richlander Feb 23, 2026
b4afd4d
Add OutputFormat resolver, rename --markout to --markdown
richlander Feb 23, 2026
9692195
Switch default output to oneline for all commands
richlander Feb 24, 2026
d959c91
Upgrade Markout to 0.9.0
richlander Feb 24, 2026
2730025
Refactor data models for oneline-first output
richlander Feb 24, 2026
e8841af
Update SKILL.md and llms.txt for v0.6.0 defaults
richlander Feb 24, 2026
d31d53b
Add design doc: service model refactoring roadmap
richlander Feb 24, 2026
39f081b
refactor: Move match classification from FindCommand into TypeSearchS…
richlander Feb 24, 2026
fff12e8
fix: Update CI smoke tests for oneline-first defaults
richlander Feb 24, 2026
962beb2
feat: Switch find --json to JSONL output
richlander Feb 24, 2026
36d1d0b
feat: Switch package search --json to JSONL output
richlander Feb 24, 2026
a31146b
fix: Remove 'search' as top-level alias for 'find'
richlander Feb 24, 2026
f9a17ad
refactor: Centralize discovery output via SelectResolver.WriteDiscove…
richlander Feb 24, 2026
e08060c
feat: Add --tree alias, deprecate --dependencies, rename RID field
richlander Feb 24, 2026
685e0cd
feat: Switch library command to oneline default output
richlander Feb 24, 2026
4910f8d
feat: Add --columns and --fields projection options
richlander Feb 24, 2026
bd26f53
feat: Unified discovery vs execute mode for projection flags
richlander Feb 24, 2026
6c611b2
feat: Wire --select values as section backpressure
richlander Feb 24, 2026
493d884
fix: Suppress FieldList warning on library oneline output
richlander Feb 24, 2026
101e4ab
feat: Use SuppressedShapes instead of per-class MarkoutIgnoreFields
richlander Feb 24, 2026
eb844f0
refactor: Remove --fields CLI option
richlander Feb 24, 2026
b66a671
chore: Switch to Markout 0.9.2 PackageReference
richlander Feb 24, 2026
73b3c3e
fix: Wire --markdown flag through router to library command
richlander Feb 24, 2026
a62b0c4
refactor: Use AutoFieldsCount for library hero summary
richlander Feb 24, 2026
b090715
Switch to Markout 0.9.3 PackageReference
richlander Feb 24, 2026
0bbd59c
Suppress hero summary in markdown when Library Info section is visible
richlander Feb 24, 2026
64925ba
Update to Markout 0.9.4
richlander Feb 25, 2026
127e211
Replace GetAssemblyInfoFields() with declarative LibraryInfoSection
richlander Feb 25, 2026
1a37a43
Replace GetSymbolsFields/GetSourceLinkAuditFields with declarative se…
richlander Feb 25, 2026
9eb0446
Extract MemberCodeView from ApiTypeView
richlander Feb 25, 2026
e6d6cfa
Rename ApiTypeView to TypeView
richlander Feb 25, 2026
2e5ce09
Update to Markout 0.9.7, remove MARKOUT005 suppression
richlander Feb 25, 2026
a2daf43
Update to Markout PR#79 API and fix -v to flip to markdown
richlander Feb 26, 2026
025c2c5
Add -k/--kind filter to type command, remove --sourcelink-only
richlander Feb 26, 2026
9fa0628
Split ApiOptions into TypeOptions/MemberOptions with own execution paths
richlander Feb 26, 2026
f7dbdd1
Add output composition model design doc
richlander Feb 26, 2026
e2d920b
Warn when --oneline conflicts with multi-section verbosity
richlander Feb 26, 2026
fcafb34
Rename MarkdownWriter → MarkdownFormatter, OneLineWriter → OneLineFor…
richlander Feb 27, 2026
a6a6f1d
Migrate to MarkoutOrchestrator and formatter interfaces
richlander Feb 27, 2026
37b74d5
Rename MarkoutOrchestrator → MarkoutWriter to match Markout Phase 4c
richlander Feb 27, 2026
a457cdb
Add --columns projection to find and implements commands
richlander Feb 27, 2026
138b3c3
Add --fields projection option across all commands
richlander Feb 27, 2026
8222bd7
Make oneline the default format for -v:q/-v:m/-v:n
richlander Feb 27, 2026
c3c9abe
Fix discovery column overflow for long section names
richlander Feb 27, 2026
77f6214
Merge -s into -S: unify section selection and projection
richlander Feb 27, 2026
2521619
Add prefix and fuzzy matching to -S section resolution
richlander Feb 27, 2026
c0856d0
Add stderr match hints for prefix/fuzzy -S resolution
richlander Feb 27, 2026
1962632
Replace prefix/fuzzy matching with exact-or-glob for -S resolution
richlander Feb 27, 2026
b812cc7
Simplify -S to sections only; remove fields from discovery
richlander Feb 27, 2026
8508243
Pass resolved section names to Markout projection
richlander Feb 27, 2026
d0e9f1e
Unify package oneline/markdown rendering pipeline
richlander Feb 27, 2026
c91961e
Add RenderDiagnostic for multi-section oneline detection
richlander Feb 27, 2026
f962c81
Remove Console from SelectResolver; add SelectOutput CLI helper
richlander Feb 27, 2026
2d528dc
Auto-promote to markdown when multi-section and format not explicit
richlander Feb 27, 2026
fa72501
Soften network guard from assert to stderr warning
richlander Feb 27, 2026
c4f3e50
Move Statistics section to Detailed verbosity
richlander Feb 28, 2026
b54110a
Use headless sections for addressable preamble; simplify BuildWriterO…
richlander Feb 28, 2026
b8d2a92
Update section-pipeline.md with headless sections and package pipeline
richlander Feb 28, 2026
8edc98a
Add section-model.md design doc with ZFS and Docker prior art
richlander Mar 2, 2026
9ace224
Expand prior art with kubectl, gh, PowerShell, DuckDB comparisons
richlander Mar 2, 2026
9161c12
Add -o vs -S philosophy to prior art summary
richlander Mar 2, 2026
314ad71
Add section diagnostics for unmatched globs and partial failures
richlander Mar 2, 2026
53b0f9a
Add SelectResolver tests for glob miss and partial failure
richlander Mar 2, 2026
0ae4d77
Error on explicit --oneline with multiple sections in library command
richlander Mar 2, 2026
21019c9
Warn when selected sections match but have no data
richlander Mar 2, 2026
86ac6e1
Add --effective flag for live section discovery
richlander Mar 2, 2026
e341eba
Fix library discovery using stale hardcoded section names
richlander Mar 2, 2026
63bd09e
Suppress empty-section warning when query also matched sections with …
richlander Mar 2, 2026
ac8ce91
Sort -S discovery list alphabetically
richlander Mar 2, 2026
cf165d4
Skip oneline warning for --effective discovery
richlander Mar 2, 2026
0d6c8f3
Fix -v:q showing empty output in oneline mode
richlander Mar 2, 2026
3ccc7f4
Split discovery (-D) from selection (-S) and fix verbosity format map…
Mar 2, 2026
dc5d0fc
Fix --fields/--columns filtering when used with -S
Mar 2, 2026
b2e6612
Add SchemaQuery design doc: Object Query Mapper for view models
Mar 2, 2026
4362876
Migrate SectionSchemaMap to Markout DocumentSchema
Mar 2, 2026
a53c3c8
Add projection diagnostics for --fields/--columns
Mar 2, 2026
393c536
Unify all commands on -D discovery, remove old discovery code
Mar 2, 2026
53019d7
Support glob patterns in -D discovery
Mar 2, 2026
b2b07fd
Fix package command to default to oneline output
Mar 2, 2026
ab263bf
Render --dependencies as pure tree with root package node
Mar 2, 2026
234ea15
Use declarative tree layout for --dependencies output
Mar 2, 2026
724f89a
Suppress tips when using -S or -D
Mar 2, 2026
768d0d8
Auto-promote multi-section discovery to grouped tree
Mar 2, 2026
b8e945f
Cache effective sections for assembly discovery
Mar 2, 2026
5eb6792
Filter effective discovery to only fields with data
Mar 3, 2026
9034c41
Auto-promote bare -D to tree at Detailed verbosity
Mar 3, 2026
08da234
Thread user verbosity through effective discovery paths
Mar 3, 2026
2c6f986
Fix --effective field-level filtering for bare -D discovery
Mar 3, 2026
3970f69
Remove legacy exclude-based section system
richlander Mar 3, 2026
1b0e74b
Replace cli command with --help -v tree view
richlander Mar 3, 2026
23c457a
Fix test compilation after exclude-based section removal
richlander Mar 3, 2026
3a78527
Auto-generate DocumentSchema from Markout source-generated schema
richlander Mar 3, 2026
420740e
Route CLI quiet mode through DocumentSchema + DiscoverOutput
richlander Mar 3, 2026
ecbbd09
Unify SelectResolver and DiscoverOutput section resolution
richlander Mar 3, 2026
6279c7c
Make bare -S list sections like bare -D
Mar 3, 2026
c579a36
Document three query paths in section model design doc
Mar 3, 2026
3c2d68f
Replace MinVerbosity with IsExpensive on section descriptors
Mar 3, 2026
3d6f078
Route second positional arg as type name or version
richlander Mar 3, 2026
38540a9
Remove contradicting verbosity gates from formatters
richlander Mar 4, 2026
7ce84dd
Remove duplicate verbosity gate in ApiCommand, delete dead RenderType…
richlander Mar 4, 2026
438612a
Add --info flag and convert Tips to Markout views
richlander Mar 6, 2026
3456187
Replace S.CL HelpAction with custom HelpWriter, add PlainText output …
richlander Mar 10, 2026
652b181
Include Summary section at quiet verbosity for compact field rendering
richlander Mar 10, 2026
8ffd797
Render help through PlainTextFormatter for consistency with tips
richlander Mar 10, 2026
57872f9
Add --plaintext option to type, member, and package commands
richlander Mar 10, 2026
d856e32
Case-insensitive assembly resolution, plaintext mode, docs parity, an…
richlander Mar 10, 2026
04b9ec1
Make Kind and Description columns available via --columns projection
richlander Mar 10, 2026
8e2ec63
Error when --oneline and -v are combined
richlander Mar 10, 2026
798683a
Generalized peel-and-probe for qualified name resolution
richlander Mar 10, 2026
a75a787
Skip member split when right part is a generic type name
richlander Mar 10, 2026
e2ce0f4
Exclude type-level sections from filtered member views
richlander Mar 10, 2026
27498cf
Show parameter list in oneline detail for single-overload members
richlander Mar 10, 2026
b7d34e6
Require at least 2 dots for peel-and-probe to activate
richlander Mar 10, 2026
aed02e7
Carry formatting options through router probe fallback path
richlander Mar 10, 2026
9b6266b
Auto-select overload index for single-overload members
richlander Mar 10, 2026
5aef917
Centralize doc enrichment tiering in SourceEnricher.EnrichDocsAsync
richlander Mar 11, 2026
40d3bc4
Split source-link audit Status into scalar fields
richlander Mar 11, 2026
5ac1d91
Add --legend flag to diff command
richlander Mar 11, 2026
07df881
Move generic type name conversion into TypeMatcher.Normalize
richlander Mar 11, 2026
f43b1e0
Switch Markout to PackageReference from nuget.org
richlander Mar 11, 2026
3d87756
Distinguish 'type not found' from 'no dependencies' in depends command
richlander Mar 11, 2026
0d6186e
Verify type exists when probing platform libraries
richlander Mar 11, 2026
0672499
Use TreeWriter directly for depends type output
richlander Mar 11, 2026
6db379e
Fall back to library mode when depends type lookup fails
richlander Mar 11, 2026
aa6ba76
Use plain error for package depends with no dependencies
richlander Mar 11, 2026
00a659a
Default implements command to oneline output
richlander Mar 11, 2026
b193d70
Add oneline support to samples --list command
richlander Mar 11, 2026
25a691a
Rewrite llms.txt and SKILL.md around core mental model
richlander Mar 11, 2026
91db855
Update demos to use type/member instead of deprecated api command
richlander Mar 11, 2026
1cc3384
Detect framework names passed as --platform library argument
richlander Mar 11, 2026
fa241ac
Fix markdownlint errors across docs and README
richlander Mar 11, 2026
027d846
Add -k to member, fix member -v:q, trim llms.txt, fix demo 18
richlander Mar 11, 2026
a568ed1
Fix NullReferenceException when member command has no type arg
richlander Mar 11, 2026
80aa0a1
Update workflow docs for member -v:q heading-only output
richlander Mar 11, 2026
efee710
Fix demo 10 empty results, caveat samples coverage in llms.txt
richlander Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,37 @@ jobs:
grep -q "## Package Dependencies" smoke-package-normal.md
grep -q "Library" smoke-package-normal.md

- name: Smoke test - type command
- name: Smoke test - type command (oneline default)
run: |
dotnet-inspect type --package System.Text.Json@10.0.0 -t 5 > smoke-type.md
dotnet-inspect type --package System.Text.Json@10.0.0 -t 5 > smoke-type.txt
cat smoke-type.txt
grep -q "JsonSerializer" smoke-type.txt

- name: Smoke test - member command (oneline default)
run: |
dotnet-inspect member JsonSerializer --package System.Text.Json@10.0.0 -m 5 > smoke-member.txt
cat smoke-member.txt
grep -q "Serialize" smoke-member.txt
grep -q "Deserialize" smoke-member.txt

- name: Smoke test - type command (markdown)
run: |
dotnet-inspect type --package System.Text.Json@10.0.0 -v:m -t 5 > smoke-type.md
cat smoke-type.md
grep -q "JsonSerializer" smoke-type.md

- name: Smoke test - member command
- name: Smoke test - member command (markdown)
run: |
dotnet-inspect member JsonSerializer --package System.Text.Json@10.0.0 -m 5 > smoke-member.md
dotnet-inspect member JsonSerializer --package System.Text.Json@10.0.0 -v:m -m 5 > smoke-member.md
cat smoke-member.md
grep -q "JsonSerializer" smoke-member.md
grep -q "Serialize" smoke-member.md
grep -q "Deserialize" smoke-member.md

- name: Smoke test - platform command
run: |
dotnet-inspect platform list > smoke-platform.md || true
cat smoke-platform.md
dotnet-inspect platform list > smoke-platform.txt || true
cat smoke-platform.txt

- name: Validate markdown output
run: |
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dnx dotnet-inspect -y -- <command>
## Quick Reference

| Command | Purpose |
|---------|---------|
| --------- | --------- |
| `package X` | Package metadata, dependencies, files, versions |
| `library X` | Library metadata, symbols, SourceLink audit, dependency tree |
| `type` | Discover types (terse, no docs) — use `--shape` for hierarchy |
Expand All @@ -28,7 +28,6 @@ dnx dotnet-inspect -y -- <command>
| `find X` | Search for types across packages, frameworks, and local assets |
| `samples X` | Fetch and display code samples |
| `platform` | List installed frameworks |
| `cli` | CLI args explorer (tree view) |

### Bare Names

Expand All @@ -37,7 +36,7 @@ A bare name like `dotnet-inspect System.Text.Json` uses a router to pick the bes
### Common Flags

| Flag | Description |
|------|-------------|
| ------ | ------------- |
| `-v:q/m/n/d` | Verbosity: quiet, minimal (default), normal, detailed |
| `--platform` | Search all platform frameworks (find, extensions, implements) |
| `--json` | JSON output |
Expand Down Expand Up @@ -224,12 +223,13 @@ dotnet-inspect cache # Show cache size breakdown
dotnet-inspect cache --clean # Clear the cache
```

### cli
### Help Tree View

```bash
dotnet-inspect cli # Tree view (single level)
dotnet-inspect cli -v:d # Deep view (all levels)
dotnet-inspect cli api # Specific command with options
dotnet-inspect -v:m # Tree view (command names + descriptions)
dotnet-inspect -v:n # Tree view (commands, args, options)
dotnet-inspect -v:d # Deep view (all levels with descriptions)
dotnet-inspect -v:q # Command names only (oneliner)
```

## Output Control
Expand Down
2 changes: 1 addition & 1 deletion docs/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Top NuGet packages by download count, sourced from <https://www.nuget.org/stats/
Flat lists of `.dll` filenames shipped with .NET 10.0. One filename per line (e.g. `System.Collections.dll`). Used to identify which assemblies belong to each platform pack, enabling de-duplication when resolving packages.

| File | Source | Count |
|------|--------|-------|
| ------ | -------- | ------- |
| `Microsoft.NETCore.App.Shared.txt` | `/usr/lib/dotnet/shared/Microsoft.NETCore.App/` | 172 |
| `Microsoft.AspNetCore.App.Shared.txt` | `/usr/lib/dotnet/shared/Microsoft.AspNetCore.App/` | 141 |
| `Microsoft.NETCore.App.Ref.txt` | `/usr/lib/dotnet/packs/Microsoft.NETCore.App.Ref/` | 167 |
Expand Down
18 changes: 9 additions & 9 deletions docs/demo-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ These queries power the `demo` command (`dotnet-inspect demo`).
## 1. Shape: INumber\<TSelf> — generic math interface

```bash
dotnet-inspect api System.Runtime "INumber<TSelf>" --shape
dotnet-inspect type "System.Numerics.INumber<TSelf>"
```

Shows the full type shape diagram for the `INumber<TSelf>` generic math interface.
The self-referential constraint (`TSelf : INumber<TSelf>`), 23 implemented interfaces
with varying type parameter combinations (`IAdditionOperators<TSelf, TSelf, TSelf>`,
`IComparisonOperators<TSelf, TSelf, bool>`), and operator methods make this the
ultimate showcase for `--shape` on an interface.
ultimate showcase for the `type` command's shape view on an interface.

## 2. Shape: Int128 — generic math concrete type

```bash
dotnet-inspect api System.Runtime Int128 --shape
dotnet-inspect type Int128 --platform System.Runtime
```

The concrete counterpart to demo #1. `Int128` is a struct implementing 31 generic
Expand All @@ -34,28 +34,28 @@ generic math hierarchy resolved with concrete types
## 3. Shape: ValueTuple — Create staircase

```bash
dotnet-inspect api System.Runtime ValueTuple --shape
dotnet-inspect type ValueTuple --platform System.Runtime
```

The `ValueTuple` factory class has 9 `Create` overloads that grow from zero to
eight type parameters, producing a visual staircase in the `--shape` output.
eight type parameters, producing a visual staircase in the shape output.
The 8-parameter version wraps into `ValueTuple<T1,...,T7,ValueTuple<T8>>` —
showing how the runtime handles arbitrary-length tuples via nesting.

## 4. API: JsonSerializer members
## 4. Members: JsonSerializer

```bash
dotnet-inspect api System.Text.Json JsonSerializer
dotnet-inspect member JsonSerializer --package System.Text.Json
```

Lists all public members of `JsonSerializer` — one of the most-used types in
modern .NET. Shows overload grouping, return types, and parameter signatures.
Good intro to the `api` command at member granularity.
Good intro to the `member` command at member granularity.

## 5. Code: OptionsFactory.Create — source, lowered C#, and IL

```bash
dotnet-inspect api --package Microsoft.Extensions.Options OptionsFactory Create
dotnet-inspect member OptionsFactory --package Microsoft.Extensions.Options -m Create
```

Shows the member detail page for `OptionsFactory<TOptions>.Create` — the
Expand Down
128 changes: 128 additions & 0 deletions docs/design/auto-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Auto-generated DocumentSchema

The discovery system (`-D`, `--fields`, `--columns`) uses `DocumentSchema` to answer
questions about what sections and items a view model contains. Previously, each command
maintained a hand-written `CreateSchemaMap()` method that duplicated information already
captured by Markout's source generator. This doc describes the replacement: a bridge
method that derives `DocumentSchema` automatically from the source-generated schema.

## Problem

Adding or renaming a section required touching two places:

1. The view model class (Markout attributes like `[MarkoutSection]`)
2. The manual `CreateSchemaMap()` in the section descriptors file

These could drift. The Markout source generator already walks the same attributes to
emit serialization code and `MarkoutSchemaInfo` metadata. The schema map was a redundant
second source of truth.

## Solution: `MarkoutSchemaInfo.ToDocumentSchema()`

A single method on `MarkoutSchemaInfo` that converts the source-generated rendering
metadata into a `DocumentSchema`:

```csharp
var schema = MarkoutContext.Default
.GetSchemaInfo<LibraryInspectionView>()!
.ToDocumentSchema();
```

This replaces all four `CreateSchemaMap()` methods and their 10 call sites.

### Rendering string → DocumentSchema mapping

The source generator produces rendering strings like `H2 Section "Dependencies" (table)`.
`ToDocumentSchema()` parses the section name and parenthetical content type, then maps
to the appropriate `DocumentSchema.Add()` call:

| Content type | ItemKind | Items source |
| ------------ | -------- | ------------ |
| `(table)` | `column` | Children with `Column` rendering → DisplayName |
| `(subsections)` | `column` | Children with `Column` rendering → DisplayName |
| `(field)` | `field` | The property's own DisplayName |
| `(fields)` | `field` | Nested children with `Field` rendering (recursive) |
| `(tree)` | `tree` | Children with `Column` rendering → DisplayName |
| `(field table)` | — | Section only (dynamic FieldCollection) |
| `(code block)` | — | Section only (no queryable items) |
| `(bar chart)` | — | Section only |
| `(distribution)` | — | Section only |
| no parens | — | Section only (e.g. bullet list) |

### Duplicate section merging

Multiple properties can share the same section name. For example, `TypeView` has 7+
properties all mapped to "Constructors" (table, docs table, overloads, code sections).
When a section name appears again, items are merged (union preserving order, deduplicated
case-insensitively). If an earlier property was section-only (e.g. code block) and a later
one has items (e.g. table with columns), the item kind is upgraded.

### Known limitations vs manual schemas

| Aspect | Manual | Auto-generated |
| ------ | ------ | -------------- |
| Field table sections (Summary, Package) | Explicit field names | Section-only (dynamic content) |
| Bullet list sections (Files, Non-normalized Paths) | Explicit item name | Section-only (no column metadata) |
| Tree sections (Dependencies, Library Refs Transitive) | Explicit item name | Section-only (TreeNode has no columns) |
| New sections/fields added to view models | Manual update needed | Automatic |
| Removed sections/fields | Manual cleanup needed | Automatic |

The "section-only" entries still appear in `-D` discovery output. The only loss is
item-level drill-down for these sections, which was manually fabricated anyway
(e.g. the manual schema listed "Path" as an item for Files, but that name didn't
correspond to any queryable property).

### Improvements over manual schemas

The auto-generated schemas are more accurate in several places:

- **Symbols** section now includes Warning and Recommendation fields
- **Vulnerabilities** correctly shows column names from PackageVulnerability
(Severity, Cve Id, Summary, Advisory Url, Ghsa Id) instead of a fake list item
- **TypeView** sections include Select, Description, Overloads, and other columns
that were missing from the manual schema
- **Type Forwarders** section correctly appears in CliApiSurface
- **Missing Source Files** section now discoverable (was absent from manual map)

## Files changed

### Markout (upstream library)

- `src/Markout/MarkoutSchemaInfo.cs` — Added `ToDocumentSchema()` and private helpers
- `tests/Markout.Tests/ProjectionTests.cs` — 9 tests covering all content type mappings,
section merging, and edge cases

### dotnet-inspect

**Replaced** (10 call sites across 5 files):

- `Commands/PackageCommand.cs` — 3 sites
- `Commands/AssemblyCommand.cs` — 2 sites
- `Commands/ApiCommand.cs` — 1 site (type + member schemas)
- `CommandLine/Commands/RouterCommandDefinition.cs` — 1 site
- `CommandLine/Commands/ApiCommandDefinitions.cs` — 2 sites

**Deleted** (4 methods across 3 files):

- `Sections/LibrarySections.CreateSchemaMap()`
- `Sections/PackageSectionDescriptors.CreateSchemaMap()`
- `Sections/ApiTypeSectionDescriptors.CreateSchemaMap()`
- `Sections/ApiMemberSectionDescriptors.CreateSchemaMap()`

## View model → schema mapping

| Call site pattern | View type |
| ----------------- | --------- |
| `MarkoutContext.Default.GetSchemaInfo<LibraryInspectionView>()!.ToDocumentSchema()` | Library command |
| `MarkoutContext.Default.GetSchemaInfo<InspectionResultView>()!.ToDocumentSchema()` | Package command |
| `MarkoutContext.Default.GetSchemaInfo<CliApiSurface>()!.ToDocumentSchema()` | API type-list |
| `MarkoutContext.Default.GetSchemaInfo<TypeView>()!.ToDocumentSchema()` | API type-detail |

## Relationship to schema-query design doc

The [schema-query](schema-query.md) doc described a five-step implementation path.
This change completes step 4 (source-generated schema) by implementing
`ToDocumentSchema()` as a runtime bridge rather than extending the source generator
itself. The generator already emits the rendering metadata; the bridge method converts
it at runtime. This avoids generator changes while achieving the same goal: one source
of truth for both rendering and querying.
14 changes: 7 additions & 7 deletions docs/design/command-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This document describes the conceptual model of dotnet-inspect commands. It serv
dotnet-inspect works with .NET libraries. There are three ways to specify where a library comes from:

| Command | Source | Example |
|---------|--------|---------|
| --------- | -------- | --------- |
| `package X` | NuGet package | `package System.Text.Json` |
| `platform X` | Local SDK/runtime | `platform System.Text.Json` |
| `library ./path` | Local file | `library ./bin/MyLib.dll` |
Expand All @@ -21,7 +21,7 @@ These commands accept the same inspection flags (`--audit`, `--sourcelink`, `--a
Once you've specified a source, flags control what information to show:

| Flag | Shows |
|------|-------|
| ------ | ------- |
| `--library` | Library metadata (version, TFM, architecture) |
| `--sourcelink` | SourceLink presence and URL (fast, no verification) |
| `--audit` | Full provenance verification (SourceLink reachability, determinism) |
Expand All @@ -42,7 +42,7 @@ dotnet inspect audit ./artifacts/*.nupkg # nupkg files
```

| Verbosity | Output |
|-----------|--------|
| ----------- | -------- |
| `-v:q` | One-line pass/fail for each check |
| `-v:n` | Audit table with source coverage summary |
| `-v:d` | Full details including missing source files |
Expand Down Expand Up @@ -130,7 +130,7 @@ When commands or flags are deprecated:

Current deprecations:

| Deprecated | Use Instead | Removal Target |
|------------|-------------|----------------|
| `package X --metadata` | `library X` | 0.3.0 |
| `--strict` | `--audit` (now always strict) | 0.3.0 |
| Deprecated | Use Instead | Removal Target |
| ---------------------- | ----------------------------- | -------------- |
| `package X --metadata` | `library X` | 0.3.0 |
| `--strict` | `--audit` (now always strict) | 0.3.0 |
30 changes: 15 additions & 15 deletions docs/design/decompiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,14 @@ reasonably interpretable.
The pipeline is designed for graceful degradation. Each phase catches exceptions
at the method level and falls back to shallower output:

| Failure point | Fallback |
| ---------------------- | --------------------------------------------------- |
| CFG construction | Emit flat IL (no block structure) |
| Stack simulation | Emit IL with CFG blocks but no type annotations |
| ILAst construction | Emit annotated IL only (skip lowered C# section) |
| Control flow structuring | Emit flat ILAst as sequential statements + goto |
| C# emission | Emit `/* unsupported: opcode */` comment inline |
| Individual expression | Emit `/* opcode arg1 arg2 */` and continue |
| Failure point | Fallback |
| ------------------------ | --------------------------------------------------- |
| CFG construction | Emit flat IL (no block structure) |
| Stack simulation | Emit IL with CFG blocks but no type annotations |
| ILAst construction | Emit annotated IL only (skip lowered C# section) |
| Control flow structuring | Emit flat ILAst as sequential statements + goto |
| C# emission | Emit `/* unsupported: opcode */` comment inline |
| Individual expression | Emit `/* opcode arg1 arg2 */` and continue |

In practice, the stress test against CoreLib's ~39K methods exercises the full
pipeline with zero failures. NuGet packages in the wild are messier (obfuscated
Expand Down Expand Up @@ -385,14 +385,14 @@ in the output rather than propagating exceptions.

### Test sources

| Source | License | Usage |
| -------------------------- | ------- | -------------------------------------------- |
| ILSpy test suite | MIT | Test cases, expected output |
| dotnet/runtime IL tests | MIT | IL verification test corpus |
| Source | License | Usage |
| -------------------------- | ------- | ------------------------------------------------------------ |
| ILSpy test suite | MIT | Test cases, expected output |
| dotnet/runtime IL tests | MIT | IL verification test corpus |
| dotnet/runtime interpreter | MIT | IL pattern coverage (generics, delegates, constrained calls) |
| dnSpyEx | GPL | Test inspiration only (never shipped) |
| Hand-written samples | N/A | `CfgSampleClass` in test project |
| Platform assemblies | N/A | Stress tests against System.Private.CoreLib |
| dnSpyEx | GPL | Test inspiration only (never shipped) |
| Hand-written samples | N/A | `CfgSampleClass` in test project |
| Platform assemblies | N/A | Stress tests against System.Private.CoreLib |

## Usage workflow

Expand Down
Loading
Loading