Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Findings Ledger CI / build-test (push) Has been cancelled
Findings Ledger CI / migration-validation (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
cryptopro-linux-csp / build-and-test (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
sm-remote-ci / build-and-test (push) Has been cancelled
Findings Ledger CI / generate-manifest (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
3.1 KiB
3.1 KiB
.NET Analyzer Design · 11-001 Entrypoint Resolver (2025-12-09)
Goals
- Resolve .NET entrypoints deterministically from project/publish artefacts and emit normalized identities (assembly name, MVID, TFM, RID, host kind, publish mode).
- Capture environment profiles (single-file, trimmed, self-contained vs framework-dependent, ALC hints) without executing payloads.
- Produce deterministic evidence aligned to
dotnet-il-metadata.schema.jsonfor downstream analyzers 11-002..005.
Inputs
*.csproj/*.fsprojmetadata (TargetFrameworks, RuntimeIdentifiers, PublishSingleFile/Trim options).- Publish outputs: apphost (
*.exe),*.dll,*.deps.json,*.runtimeconfig.json,*.targetscache. - RID graph from SDK (offline snapshot in repo), deterministic time provider.
Outputs
entrypoints[]records:assembly,mvid,tfm,rid,hostKind(apphost/framework-dependent/self-contained),publishMode(single-file/trimmed),alcHints(AssemblyLoadContext names),probingPaths,nativeDeps(apphost bundles).- Evidence:
LanguageComponentEvidenceentries per entrypoint with locator = publish path, hash over file bytes for determinism. - Diagnostics: missing deps/runtimeconfig, mixed RID publish, single-file without extractor support.
Algorithm (deterministic)
- Parse project: target frameworks, RIDs, publish flags; normalize to ordered sets.
- Discover publish artefacts under
bin/<Configuration>/<TFM>/...andpublish/folders; prefer*.runtimeconfig.jsonwhen present. - Read
*.deps.jsonto extract runtime targets and resolve primary entry assembly; fall back toapphostname. - Compute MVID from PE header; compute SHA-256 over
*.dll/*.exebytes; capture file size. - Classify host:
apphostpresent ->hostKind = apphost; detect single-file bundle via marker sections.- Framework-dependent ->
hostKind = framework-dependent; useruntimeconfigprobing paths.
- Infer ALC hints: scan deps for
runtimeconfig.dev.jsonprobing paths andadditionalProbingPaths; add known SDK paths. - Emit entrypoint with deterministic ordering: sort by assembly name, then RID, then TFM.
Determinism & Offline
- No network access; relies solely on on-disk project/publish artefacts.
- Stable ordering and casing (
Ordinalsort), UTC time provider. - Hashes: SHA-256 over file bytes; no timestamps.
Test & Fixture Plan
- Existing suite:
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.DotNet.Tests(now green; TRX atTestResults/dotnet/dotnet-tests.trx). - Fixtures to maintain:
- Framework-dependent app with deps/runtimeconfig.
- Self-contained single-file publish (bundle) with apphost.
- Trimmed publish with ALC hints.
- Multi-RID publish verifying RID selection and deterministic ordering.
- Add new fixtures under
...DotNet.Tests/Fixtures/when new host kinds are supported; keep hashes stable.
Next Steps
- Wire readiness checkpoints to mark 11-001 design+tests complete; keep CI runner validation optional (DEVOPS-SCANNER-CI-11-001) for reproducibility.
- Feed outputs into 11-002..005 analyzers once entrypoint metadata is consumed by downstream IL/reflection pipelines.