necropsy 0.2.0 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/MEASUREMENTS.md +27 -0
- data/README.md +182 -17
- data/bench/README.md +92 -0
- data/bench/audit.rb +113 -0
- data/bench/audits/0.2.1/audit.json +501 -0
- data/bench/audits/0.2.1/audit.md +55 -0
- data/bench/audits/0.2.1/baseline_performance.yml +16 -0
- data/bench/audits/0.2.1/config.yml +42 -0
- data/bench/audits/0.2.1/review.yml +56 -0
- data/bench/audits/0.2.1/review_queue.yml +3651 -0
- data/bench/corpora/v1/README.md +30 -0
- data/bench/corpora/v1/labels.yml +37 -0
- data/bench/corpora/v1/manifest.yml +63 -0
- data/bench/corpora/v1/rubocop.necropsy.yml +7 -0
- data/bench/corpora/v1/self.necropsy.yml +8 -0
- data/bench/corpora/v1/tools/debride.yml +42 -0
- data/bench/corpora/v1/tools/spoom.yml +12 -0
- data/bench/corpora/v1/tools/type_aware.yml +11 -0
- data/bench/golden/v1/candidate_union.json +21918 -0
- data/bench/golden/v1/metadata.json +12 -0
- data/bench/golden/v1/reports/dynamic_evidence.json +146 -0
- data/bench/golden/v1/reports/plain_ruby.json +135 -0
- data/bench/golden/v1/reports/rails.json +176 -0
- data/bench/golden/v1/reports/rubocop_1_75_0.json +26848 -0
- data/bench/golden/v1/reports/self.json +3449 -0
- data/bench/review_queue.rb +35 -0
- data/bench/run.rb +31 -0
- data/bench/schema/candidate-union-v1.schema.json +70 -0
- data/docs/impv_implementation_matrix.md +179 -0
- data/docs/migrations/0.2.1.md +57 -0
- data/docs/migrations/0.3.0.md +207 -0
- data/docs/migrations/0.4.0.md +13 -0
- data/docs/necropsy_performance_adr.md +43 -0
- data/docs/necropsy_scope_decisions.md +58 -0
- data/docs/necropsy_type_facts_adr.md +22 -0
- data/gemfiles/prism_min.gemfile +9 -0
- data/gemfiles/prism_min.gemfile.lock +50 -0
- data/lib/necropsy/analyzer.rb +121 -2
- data/lib/necropsy/analyzers/dynamic/coverage_collector.rb +69 -17
- data/lib/necropsy/analyzers/dynamic/coverage_importer.rb +99 -9
- data/lib/necropsy/analyzers/dynamic/coverband_importer.rb +69 -299
- data/lib/necropsy/analyzers/dynamic/coverband_payload_set.rb +149 -0
- data/lib/necropsy/analyzers/dynamic/observation_policy.rb +96 -0
- data/lib/necropsy/analyzers/dynamic/redis_input_limits.rb +121 -0
- data/lib/necropsy/analyzers/dynamic/redis_nonblocking_io.rb +94 -0
- data/lib/necropsy/analyzers/dynamic/redis_payload_loader.rb +165 -0
- data/lib/necropsy/analyzers/dynamic/redis_transport.rb +217 -0
- data/lib/necropsy/analyzers/dynamic/runtime_reference.rb +96 -0
- data/lib/necropsy/analyzers/dynamic/trace_point_collector.rb +133 -23
- data/lib/necropsy/analyzers/dynamic/trace_point_importer.rb +3 -1
- data/lib/necropsy/analyzers/legacy_result_adapter.rb +226 -0
- data/lib/necropsy/analyzers/static/cha.rb +33 -73
- data/lib/necropsy/analyzers/static/name_resolution.rb +133 -12
- data/lib/necropsy/analyzers/static/rta.rb +237 -29
- data/lib/necropsy/ast_scanner/call_recording.rb +149 -30
- data/lib/necropsy/ast_scanner/call_site_creation.rb +54 -0
- data/lib/necropsy/ast_scanner/definition_creation.rb +43 -0
- data/lib/necropsy/ast_scanner/dsl_macros.rb +431 -41
- data/lib/necropsy/ast_scanner/method_definitions.rb +232 -50
- data/lib/necropsy/ast_scanner/references.rb +43 -9
- data/lib/necropsy/ast_scanner/ruby_semantics.rb +101 -15
- data/lib/necropsy/ast_scanner/traversal.rb +234 -71
- data/lib/necropsy/ast_scanner/value_definitions.rb +23 -13
- data/lib/necropsy/ast_scanner.rb +67 -6
- data/lib/necropsy/bench/candidate_union.rb +555 -0
- data/lib/necropsy/bench/claim_gate.rb +112 -0
- data/lib/necropsy/bench/evaluator.rb +329 -16
- data/lib/necropsy/bench/finding_facts.rb +152 -0
- data/lib/necropsy/bench/precision_gate.rb +144 -0
- data/lib/necropsy/bench/release_audit/adversarial_runner.rb +56 -0
- data/lib/necropsy/bench/release_audit/artifact_writer.rb +112 -0
- data/lib/necropsy/bench/release_audit/config_validator.rb +112 -0
- data/lib/necropsy/bench/release_audit/git_snapshot.rb +36 -0
- data/lib/necropsy/bench/release_audit/performance_gate.rb +165 -0
- data/lib/necropsy/bench/release_audit/run_provenance.rb +133 -0
- data/lib/necropsy/bench/release_audit.rb +360 -0
- data/lib/necropsy/bench/report_normalizer.rb +140 -0
- data/lib/necropsy/bench/review_queue.rb +154 -0
- data/lib/necropsy/bench/safety_mutation_harness.rb +59 -0
- data/lib/necropsy/bench/seed_runner.rb +408 -0
- data/lib/necropsy/bounded_canonicalizer.rb +218 -0
- data/lib/necropsy/cache/scan_cache.rb +85 -17
- data/lib/necropsy/call_site_identity.rb +54 -0
- data/lib/necropsy/cli.rb +220 -33
- data/lib/necropsy/clock.rb +40 -0
- data/lib/necropsy/confidence/scorer.rb +103 -58
- data/lib/necropsy/configuration.rb +224 -21
- data/lib/necropsy/convention_rules.rb +138 -0
- data/lib/necropsy/definition_identity/canonical_digest.rb +278 -0
- data/lib/necropsy/definition_identity.rb +37 -0
- data/lib/necropsy/diagnostics.rb +176 -36
- data/lib/necropsy/embedded_ruby.rb +55 -0
- data/lib/necropsy/entry_points/plain.rb +111 -10
- data/lib/necropsy/entry_points/rails.rb +322 -41
- data/lib/necropsy/entry_points/test.rb +6 -1
- data/lib/necropsy/flow_interpreter.rb +460 -0
- data/lib/necropsy/graph/blocker_matching.rb +338 -0
- data/lib/necropsy/graph/call_graph.rb +1099 -109
- data/lib/necropsy/graph/definition_index.rb +149 -0
- data/lib/necropsy/graph/dynamic_evidence_tracking.rb +206 -0
- data/lib/necropsy/graph/evidence_store.rb +213 -0
- data/lib/necropsy/graph/resolution_store.rb +497 -0
- data/lib/necropsy/graph_self_check.rb +79 -0
- data/lib/necropsy/guardrail/baseline.rb +350 -13
- data/lib/necropsy/guardrail/quarantine.rb +94 -9
- data/lib/necropsy/load_graph.rb +206 -0
- data/lib/necropsy/models.rb +878 -13
- data/lib/necropsy/performance_profiler.rb +108 -0
- data/lib/necropsy/project.rb +327 -25
- data/lib/necropsy/reachability/engine.rb +54 -13
- data/lib/necropsy/reference_barrier.rb +458 -0
- data/lib/necropsy/report.rb +113 -4
- data/lib/necropsy/reporter.rb +431 -15
- data/lib/necropsy/runner.rb +233 -18
- data/lib/necropsy/runtime_feedback.rb +136 -0
- data/lib/necropsy/semantics_matrix.rb +153 -0
- data/lib/necropsy/type_facts.rb +53 -0
- data/lib/necropsy/version.rb +1 -1
- data/lib/necropsy/why_not_explanation.rb +436 -0
- data/lib/necropsy/why_not_renderer.rb +197 -0
- data/lib/necropsy/world_policy.rb +90 -0
- data/lib/necropsy.rb +35 -2
- data/schema/necropsy-report-v2.schema.json +366 -0
- metadata +85 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'digest'
|
|
4
|
+
|
|
5
|
+
module Necropsy
|
|
6
|
+
class WorldPolicy
|
|
7
|
+
def initialize(graph:, project:)
|
|
8
|
+
@graph = graph
|
|
9
|
+
@project = project
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def apply
|
|
13
|
+
protect_library_surface if config.library_world?
|
|
14
|
+
add_conservative_load_roots if config.load_roots == :all
|
|
15
|
+
LoadGraph.new(graph: graph, project: project).apply
|
|
16
|
+
record_policy
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
attr_reader :graph, :project
|
|
22
|
+
|
|
23
|
+
def config
|
|
24
|
+
project.config
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def protect_library_surface
|
|
28
|
+
graph.method_nodes.reject(&:test).select { |node| %i[public protected].include?(node.visibility) }.each do |node|
|
|
29
|
+
graph.add_entry_point(
|
|
30
|
+
node.graph_id,
|
|
31
|
+
:library_public_api,
|
|
32
|
+
domain: :external,
|
|
33
|
+
evidence: {
|
|
34
|
+
'type' => 'world_policy',
|
|
35
|
+
'world' => 'library',
|
|
36
|
+
'visibility' => node.visibility.to_s
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
graph.add_blocker(open_public_api_blocker(node))
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def open_public_api_blocker(node)
|
|
44
|
+
Blocker.new(
|
|
45
|
+
kind: :open_public_api,
|
|
46
|
+
scope_kind: :definition,
|
|
47
|
+
scope_value: node.graph_id,
|
|
48
|
+
source: :world_policy,
|
|
49
|
+
reason: 'Library public and protected APIs may have callers outside the repository',
|
|
50
|
+
suggested_action: :review_external_contract,
|
|
51
|
+
metadata: {
|
|
52
|
+
'caller_domain' => 'runtime',
|
|
53
|
+
'root_domain' => 'external',
|
|
54
|
+
'receiver_kind' => 'implicit',
|
|
55
|
+
'world' => 'library',
|
|
56
|
+
'visibility' => node.visibility.to_s
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def add_conservative_load_roots
|
|
62
|
+
graph.nodes.values.select { |node| node.kind == :block_entry && !node.test }.each do |node|
|
|
63
|
+
graph.add_entry_point(
|
|
64
|
+
node.graph_id,
|
|
65
|
+
:production_load_unit,
|
|
66
|
+
domain: :runtime,
|
|
67
|
+
evidence: {
|
|
68
|
+
'type' => 'load_policy',
|
|
69
|
+
'policy' => 'all',
|
|
70
|
+
'file' => node.file
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def record_policy
|
|
77
|
+
graph.observation['world_policy'] = {
|
|
78
|
+
'world' => config.world.to_s,
|
|
79
|
+
'load_roots' => config.load_roots.to_s,
|
|
80
|
+
'configuration_sha256' => configuration_digest
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def configuration_digest
|
|
85
|
+
Digest::SHA256.hexdigest(BoundedCanonicalizer.dump(config.scan_cache_key))
|
|
86
|
+
rescue StandardError, SystemStackError
|
|
87
|
+
'unavailable'
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
data/lib/necropsy.rb
CHANGED
|
@@ -4,16 +4,35 @@
|
|
|
4
4
|
require 'set' # rubocop:disable Lint/RedundantRequireStatement
|
|
5
5
|
|
|
6
6
|
require_relative 'necropsy/version'
|
|
7
|
+
require_relative 'necropsy/clock'
|
|
8
|
+
require_relative 'necropsy/bounded_canonicalizer'
|
|
9
|
+
require_relative 'necropsy/call_site_identity'
|
|
7
10
|
require_relative 'necropsy/models'
|
|
11
|
+
require_relative 'necropsy/definition_identity'
|
|
8
12
|
require_relative 'necropsy/configuration'
|
|
13
|
+
require_relative 'necropsy/flow_interpreter'
|
|
14
|
+
require_relative 'necropsy/convention_rules'
|
|
15
|
+
require_relative 'necropsy/type_facts'
|
|
16
|
+
require_relative 'necropsy/runtime_feedback'
|
|
17
|
+
require_relative 'necropsy/performance_profiler'
|
|
18
|
+
require_relative 'necropsy/embedded_ruby'
|
|
9
19
|
require_relative 'necropsy/ast_scanner'
|
|
10
20
|
require_relative 'necropsy/cache/scan_cache'
|
|
11
21
|
require_relative 'necropsy/project'
|
|
22
|
+
require_relative 'necropsy/graph/definition_index'
|
|
23
|
+
require_relative 'necropsy/graph/dynamic_evidence_tracking'
|
|
24
|
+
require_relative 'necropsy/graph/evidence_store'
|
|
25
|
+
require_relative 'necropsy/graph/blocker_matching'
|
|
26
|
+
require_relative 'necropsy/graph/resolution_store'
|
|
12
27
|
require_relative 'necropsy/graph/call_graph'
|
|
28
|
+
require_relative 'necropsy/graph_self_check'
|
|
29
|
+
require_relative 'necropsy/semantics_matrix'
|
|
13
30
|
require_relative 'necropsy/analyzer'
|
|
31
|
+
require_relative 'necropsy/analyzers/legacy_result_adapter'
|
|
14
32
|
require_relative 'necropsy/analyzers/static/name_resolution'
|
|
15
33
|
require_relative 'necropsy/analyzers/static/cha'
|
|
16
34
|
require_relative 'necropsy/analyzers/static/rta'
|
|
35
|
+
require_relative 'necropsy/analyzers/dynamic/observation_policy'
|
|
17
36
|
require_relative 'necropsy/analyzers/dynamic/coverage_importer'
|
|
18
37
|
require_relative 'necropsy/analyzers/dynamic/coverage_collector'
|
|
19
38
|
require_relative 'necropsy/analyzers/dynamic/coverband_importer'
|
|
@@ -22,22 +41,36 @@ require_relative 'necropsy/analyzers/dynamic/trace_point_collector'
|
|
|
22
41
|
require_relative 'necropsy/entry_points/plain'
|
|
23
42
|
require_relative 'necropsy/entry_points/rails'
|
|
24
43
|
require_relative 'necropsy/entry_points/test'
|
|
44
|
+
require_relative 'necropsy/load_graph'
|
|
45
|
+
require_relative 'necropsy/world_policy'
|
|
25
46
|
require_relative 'necropsy/reachability/engine'
|
|
26
47
|
require_relative 'necropsy/confidence/scorer'
|
|
27
48
|
require_relative 'necropsy/report'
|
|
28
49
|
require_relative 'necropsy/reporter'
|
|
50
|
+
require_relative 'necropsy/why_not_explanation'
|
|
51
|
+
require_relative 'necropsy/why_not_renderer'
|
|
29
52
|
require_relative 'necropsy/diagnostics'
|
|
53
|
+
require_relative 'necropsy/reference_barrier'
|
|
30
54
|
require_relative 'necropsy/guardrail/baseline'
|
|
31
55
|
require_relative 'necropsy/guardrail/diff'
|
|
32
56
|
require_relative 'necropsy/guardrail/quarantine'
|
|
57
|
+
require_relative 'necropsy/bench/finding_facts'
|
|
33
58
|
require_relative 'necropsy/bench/evaluator'
|
|
59
|
+
require_relative 'necropsy/bench/claim_gate'
|
|
60
|
+
require_relative 'necropsy/bench/review_queue'
|
|
34
61
|
require_relative 'necropsy/runner'
|
|
35
62
|
|
|
36
63
|
module Necropsy
|
|
37
64
|
class Error < StandardError; end
|
|
38
65
|
|
|
39
|
-
def self.analyze(root: '.', config_path: nil, analyzers: nil)
|
|
40
|
-
Runner.new(
|
|
66
|
+
def self.analyze(root: '.', config_path: nil, analyzers: nil, ignored_reference_paths: [], profile: false, as_of: nil)
|
|
67
|
+
Runner.new(
|
|
68
|
+
root: root,
|
|
69
|
+
config_path: config_path,
|
|
70
|
+
analyzers: analyzers,
|
|
71
|
+
ignored_reference_paths: ignored_reference_paths,
|
|
72
|
+
as_of: as_of
|
|
73
|
+
).analyze(profile: profile)
|
|
41
74
|
end
|
|
42
75
|
|
|
43
76
|
def self.default_analyzers
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/ydah/necropsy/blob/main/schema/necropsy-report-v2.schema.json",
|
|
4
|
+
"title": "Necropsy report v2",
|
|
5
|
+
"description": "Stable machine-readable report emitted by Necropsy JSON and YAML reporters.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"schema_version",
|
|
9
|
+
"artifact_provenance",
|
|
10
|
+
"compatibility",
|
|
11
|
+
"root",
|
|
12
|
+
"analysis_health",
|
|
13
|
+
"summary",
|
|
14
|
+
"findings"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"schema_version": { "const": 2 },
|
|
18
|
+
"artifact_provenance": { "$ref": "#/$defs/artifactProvenance" },
|
|
19
|
+
"compatibility": { "$ref": "#/$defs/compatibility" },
|
|
20
|
+
"root": { "type": "string", "minLength": 1 },
|
|
21
|
+
"analysis_health": { "$ref": "#/$defs/analysisHealth" },
|
|
22
|
+
"summary": { "$ref": "#/$defs/summary" },
|
|
23
|
+
"findings": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": { "$ref": "#/$defs/finding" }
|
|
26
|
+
},
|
|
27
|
+
"diagnostics": { "type": "object" },
|
|
28
|
+
"source_snapshot": { "$ref": "#/$defs/sourceSnapshot" },
|
|
29
|
+
"graph": { "$ref": "#/$defs/graph" }
|
|
30
|
+
},
|
|
31
|
+
"additionalProperties": true,
|
|
32
|
+
"$defs": {
|
|
33
|
+
"sha256": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
36
|
+
},
|
|
37
|
+
"artifactProvenance": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": ["producer", "runtime", "identity_schemas", "inputs"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"producer": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"required": ["name", "version"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"name": { "const": "necropsy" },
|
|
46
|
+
"version": { "type": "string", "minLength": 1 }
|
|
47
|
+
},
|
|
48
|
+
"additionalProperties": true
|
|
49
|
+
},
|
|
50
|
+
"runtime": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"required": ["ruby_engine", "ruby_version", "prism_version"],
|
|
53
|
+
"properties": {
|
|
54
|
+
"ruby_engine": { "type": "string", "minLength": 1 },
|
|
55
|
+
"ruby_version": { "type": "string", "minLength": 1 },
|
|
56
|
+
"prism_version": { "type": "string", "minLength": 1 }
|
|
57
|
+
},
|
|
58
|
+
"additionalProperties": true
|
|
59
|
+
},
|
|
60
|
+
"identity_schemas": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": ["definition", "call_site"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"definition": { "type": "integer", "minimum": 1 },
|
|
65
|
+
"call_site": { "type": "integer", "minimum": 1 }
|
|
66
|
+
},
|
|
67
|
+
"additionalProperties": true
|
|
68
|
+
},
|
|
69
|
+
"inputs": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"required": ["configuration_sha256"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"configuration_sha256": {
|
|
74
|
+
"oneOf": [
|
|
75
|
+
{ "$ref": "#/$defs/sha256" },
|
|
76
|
+
{ "const": "unavailable" }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"additionalProperties": true
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"additionalProperties": true
|
|
84
|
+
},
|
|
85
|
+
"compatibility": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"required": ["finding_fingerprints"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"finding_fingerprints": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"required": ["fingerprint", "physical_fingerprint"],
|
|
92
|
+
"properties": {
|
|
93
|
+
"fingerprint": { "type": "string", "minLength": 1 },
|
|
94
|
+
"physical_fingerprint": { "type": "string", "minLength": 1 }
|
|
95
|
+
},
|
|
96
|
+
"additionalProperties": true
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"additionalProperties": true
|
|
100
|
+
},
|
|
101
|
+
"analysisHealth": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"required": ["status", "reasons"],
|
|
104
|
+
"properties": {
|
|
105
|
+
"status": { "enum": ["complete", "degraded", "invalid"] },
|
|
106
|
+
"reasons": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"items": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"required": ["severity", "code"],
|
|
111
|
+
"properties": {
|
|
112
|
+
"severity": { "enum": ["degraded", "invalid"] },
|
|
113
|
+
"code": { "type": "string", "minLength": 1 },
|
|
114
|
+
"message": { "type": "string" },
|
|
115
|
+
"file": { "type": "string" },
|
|
116
|
+
"line": { "type": "integer", "minimum": 1 }
|
|
117
|
+
},
|
|
118
|
+
"additionalProperties": true
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"additionalProperties": true
|
|
123
|
+
},
|
|
124
|
+
"summary": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"required": [
|
|
127
|
+
"nodes",
|
|
128
|
+
"edges",
|
|
129
|
+
"entry_points",
|
|
130
|
+
"incomplete_files",
|
|
131
|
+
"findings",
|
|
132
|
+
"actionable",
|
|
133
|
+
"diagnostic",
|
|
134
|
+
"health_failures",
|
|
135
|
+
"unreachable",
|
|
136
|
+
"unused",
|
|
137
|
+
"blocked",
|
|
138
|
+
"test_only_reachable"
|
|
139
|
+
],
|
|
140
|
+
"properties": {
|
|
141
|
+
"nodes": { "$ref": "#/$defs/count" },
|
|
142
|
+
"edges": { "$ref": "#/$defs/count" },
|
|
143
|
+
"entry_points": { "$ref": "#/$defs/count" },
|
|
144
|
+
"incomplete_files": { "$ref": "#/$defs/count" },
|
|
145
|
+
"findings": { "$ref": "#/$defs/count" },
|
|
146
|
+
"actionable": { "$ref": "#/$defs/count" },
|
|
147
|
+
"diagnostic": { "$ref": "#/$defs/count" },
|
|
148
|
+
"health_failures": { "$ref": "#/$defs/count" },
|
|
149
|
+
"unreachable": { "$ref": "#/$defs/count" },
|
|
150
|
+
"unused": { "$ref": "#/$defs/count" },
|
|
151
|
+
"blocked": { "$ref": "#/$defs/count" },
|
|
152
|
+
"test_only_reachable": { "$ref": "#/$defs/count" }
|
|
153
|
+
},
|
|
154
|
+
"additionalProperties": true
|
|
155
|
+
},
|
|
156
|
+
"count": {
|
|
157
|
+
"type": "integer",
|
|
158
|
+
"minimum": 0
|
|
159
|
+
},
|
|
160
|
+
"finding": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"required": [
|
|
163
|
+
"fingerprint",
|
|
164
|
+
"logical_fingerprint",
|
|
165
|
+
"physical_fingerprint",
|
|
166
|
+
"classification",
|
|
167
|
+
"confidence",
|
|
168
|
+
"score",
|
|
169
|
+
"score_components",
|
|
170
|
+
"node",
|
|
171
|
+
"reasons",
|
|
172
|
+
"evidences",
|
|
173
|
+
"blockers"
|
|
174
|
+
],
|
|
175
|
+
"properties": {
|
|
176
|
+
"fingerprint": { "$ref": "#/$defs/sha256" },
|
|
177
|
+
"logical_fingerprint": { "$ref": "#/$defs/sha256" },
|
|
178
|
+
"physical_fingerprint": { "$ref": "#/$defs/sha256" },
|
|
179
|
+
"classification": {
|
|
180
|
+
"enum": ["unreachable", "unused", "blocked", "test_only_reachable"]
|
|
181
|
+
},
|
|
182
|
+
"confidence": { "enum": ["low", "medium", "high", "certain"] },
|
|
183
|
+
"score": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
184
|
+
"score_components": {
|
|
185
|
+
"type": "array",
|
|
186
|
+
"items": { "$ref": "#/$defs/scoreComponent" }
|
|
187
|
+
},
|
|
188
|
+
"node": { "$ref": "#/$defs/node" },
|
|
189
|
+
"reasons": {
|
|
190
|
+
"type": "array",
|
|
191
|
+
"items": { "type": "string" }
|
|
192
|
+
},
|
|
193
|
+
"evidences": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": { "$ref": "#/$defs/evidence" }
|
|
196
|
+
},
|
|
197
|
+
"blockers": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"items": { "$ref": "#/$defs/blocker" }
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"additionalProperties": true
|
|
203
|
+
},
|
|
204
|
+
"node": {
|
|
205
|
+
"type": "object",
|
|
206
|
+
"required": [
|
|
207
|
+
"id",
|
|
208
|
+
"symbol_id",
|
|
209
|
+
"definition_id",
|
|
210
|
+
"body_digest",
|
|
211
|
+
"ordinal",
|
|
212
|
+
"kind",
|
|
213
|
+
"file",
|
|
214
|
+
"line",
|
|
215
|
+
"end_line",
|
|
216
|
+
"defined_via",
|
|
217
|
+
"owner",
|
|
218
|
+
"name",
|
|
219
|
+
"test",
|
|
220
|
+
"visibility"
|
|
221
|
+
],
|
|
222
|
+
"properties": {
|
|
223
|
+
"id": { "type": "string", "minLength": 1 },
|
|
224
|
+
"symbol_id": { "type": "string", "minLength": 1 },
|
|
225
|
+
"definition_id": { "type": "string", "minLength": 1 },
|
|
226
|
+
"body_digest": {
|
|
227
|
+
"oneOf": [
|
|
228
|
+
{ "$ref": "#/$defs/sha256" },
|
|
229
|
+
{ "type": "null" }
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"ordinal": { "type": "integer", "minimum": 0 },
|
|
233
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
234
|
+
"file": { "type": "string", "minLength": 1 },
|
|
235
|
+
"line": { "type": "integer", "minimum": 1 },
|
|
236
|
+
"end_line": { "type": "integer", "minimum": 1 },
|
|
237
|
+
"defined_via": { "type": "string", "minLength": 1 },
|
|
238
|
+
"owner": { "type": ["string", "null"] },
|
|
239
|
+
"name": { "type": ["string", "null"] },
|
|
240
|
+
"test": { "type": "boolean" },
|
|
241
|
+
"visibility": { "enum": ["public", "protected", "private"] }
|
|
242
|
+
},
|
|
243
|
+
"additionalProperties": true
|
|
244
|
+
},
|
|
245
|
+
"scoreComponent": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"required": ["name", "value", "details"],
|
|
248
|
+
"properties": {
|
|
249
|
+
"name": { "type": "string", "minLength": 1 },
|
|
250
|
+
"value": { "type": "number" },
|
|
251
|
+
"details": { "type": "string" }
|
|
252
|
+
},
|
|
253
|
+
"additionalProperties": true
|
|
254
|
+
},
|
|
255
|
+
"evidence": {
|
|
256
|
+
"type": "object",
|
|
257
|
+
"required": [
|
|
258
|
+
"analyzer",
|
|
259
|
+
"kind",
|
|
260
|
+
"weight",
|
|
261
|
+
"details",
|
|
262
|
+
"metadata",
|
|
263
|
+
"evidence_id",
|
|
264
|
+
"producer",
|
|
265
|
+
"producer_version",
|
|
266
|
+
"grade",
|
|
267
|
+
"relation",
|
|
268
|
+
"source",
|
|
269
|
+
"assumptions",
|
|
270
|
+
"scope"
|
|
271
|
+
],
|
|
272
|
+
"properties": {
|
|
273
|
+
"analyzer": { "type": "string", "minLength": 1 },
|
|
274
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
275
|
+
"weight": { "type": "number" },
|
|
276
|
+
"details": { "type": "string" },
|
|
277
|
+
"metadata": { "type": "object" },
|
|
278
|
+
"evidence_id": { "type": ["string", "null"] },
|
|
279
|
+
"producer": { "type": ["string", "null"] },
|
|
280
|
+
"producer_version": { "type": ["string", "null"] },
|
|
281
|
+
"grade": {
|
|
282
|
+
"oneOf": [
|
|
283
|
+
{ "enum": ["exact", "conservative", "observed", "heuristic"] },
|
|
284
|
+
{ "type": "null" }
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
"relation": { "type": ["string", "null"] },
|
|
288
|
+
"source": {},
|
|
289
|
+
"assumptions": {
|
|
290
|
+
"type": "array",
|
|
291
|
+
"items": { "type": "string" }
|
|
292
|
+
},
|
|
293
|
+
"scope": {}
|
|
294
|
+
},
|
|
295
|
+
"additionalProperties": true
|
|
296
|
+
},
|
|
297
|
+
"blocker": {
|
|
298
|
+
"type": "object",
|
|
299
|
+
"required": ["kind", "scope_kind", "scope_value", "source", "reason", "suggested_action", "metadata"],
|
|
300
|
+
"properties": {
|
|
301
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
302
|
+
"scope_kind": { "type": "string", "minLength": 1 },
|
|
303
|
+
"scope_value": {},
|
|
304
|
+
"source": {},
|
|
305
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
306
|
+
"suggested_action": { "type": "string", "minLength": 1 },
|
|
307
|
+
"metadata": { "type": "object" }
|
|
308
|
+
},
|
|
309
|
+
"additionalProperties": true
|
|
310
|
+
},
|
|
311
|
+
"sourceSnapshot": {
|
|
312
|
+
"type": "object",
|
|
313
|
+
"required": ["status", "sha256"],
|
|
314
|
+
"properties": {
|
|
315
|
+
"status": { "enum": ["complete", "unavailable"] },
|
|
316
|
+
"sha256": {
|
|
317
|
+
"oneOf": [
|
|
318
|
+
{ "$ref": "#/$defs/sha256" },
|
|
319
|
+
{ "const": "unavailable" }
|
|
320
|
+
]
|
|
321
|
+
},
|
|
322
|
+
"files": { "$ref": "#/$defs/count" },
|
|
323
|
+
"bytes": { "$ref": "#/$defs/count" },
|
|
324
|
+
"reason": { "type": "string" },
|
|
325
|
+
"verification": { "type": "object" }
|
|
326
|
+
},
|
|
327
|
+
"additionalProperties": true
|
|
328
|
+
},
|
|
329
|
+
"graph": {
|
|
330
|
+
"type": "object",
|
|
331
|
+
"required": [
|
|
332
|
+
"nodes",
|
|
333
|
+
"call_sites",
|
|
334
|
+
"edges",
|
|
335
|
+
"edge_projection",
|
|
336
|
+
"edge_relations",
|
|
337
|
+
"evidence_records",
|
|
338
|
+
"entry_points",
|
|
339
|
+
"profiles",
|
|
340
|
+
"resolutions",
|
|
341
|
+
"blockers",
|
|
342
|
+
"file_statuses",
|
|
343
|
+
"source_errors",
|
|
344
|
+
"source_domains",
|
|
345
|
+
"observation"
|
|
346
|
+
],
|
|
347
|
+
"properties": {
|
|
348
|
+
"nodes": { "type": "array", "items": { "$ref": "#/$defs/node" } },
|
|
349
|
+
"call_sites": { "type": "array" },
|
|
350
|
+
"edges": { "type": "array" },
|
|
351
|
+
"edge_projection": { "const": "conservative" },
|
|
352
|
+
"edge_relations": { "type": "array" },
|
|
353
|
+
"evidence_records": { "type": "array", "items": { "$ref": "#/$defs/evidence" } },
|
|
354
|
+
"entry_points": { "type": "array" },
|
|
355
|
+
"profiles": { "type": "array" },
|
|
356
|
+
"resolutions": { "type": "array" },
|
|
357
|
+
"blockers": { "type": "array", "items": { "$ref": "#/$defs/blocker" } },
|
|
358
|
+
"file_statuses": { "type": "object" },
|
|
359
|
+
"source_errors": { "type": "array" },
|
|
360
|
+
"source_domains": { "type": "object" },
|
|
361
|
+
"observation": { "type": "object" }
|
|
362
|
+
},
|
|
363
|
+
"additionalProperties": true
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: necropsy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yudai Takada
|
|
@@ -44,47 +44,131 @@ files:
|
|
|
44
44
|
- MEASUREMENTS.md
|
|
45
45
|
- README.md
|
|
46
46
|
- Rakefile
|
|
47
|
+
- bench/README.md
|
|
48
|
+
- bench/audit.rb
|
|
49
|
+
- bench/audits/0.2.1/audit.json
|
|
50
|
+
- bench/audits/0.2.1/audit.md
|
|
51
|
+
- bench/audits/0.2.1/baseline_performance.yml
|
|
52
|
+
- bench/audits/0.2.1/config.yml
|
|
53
|
+
- bench/audits/0.2.1/review.yml
|
|
54
|
+
- bench/audits/0.2.1/review_queue.yml
|
|
55
|
+
- bench/corpora/v1/README.md
|
|
56
|
+
- bench/corpora/v1/labels.yml
|
|
57
|
+
- bench/corpora/v1/manifest.yml
|
|
58
|
+
- bench/corpora/v1/rubocop.necropsy.yml
|
|
59
|
+
- bench/corpora/v1/self.necropsy.yml
|
|
60
|
+
- bench/corpora/v1/tools/debride.yml
|
|
61
|
+
- bench/corpora/v1/tools/spoom.yml
|
|
62
|
+
- bench/corpora/v1/tools/type_aware.yml
|
|
63
|
+
- bench/golden/v1/candidate_union.json
|
|
64
|
+
- bench/golden/v1/metadata.json
|
|
65
|
+
- bench/golden/v1/reports/dynamic_evidence.json
|
|
66
|
+
- bench/golden/v1/reports/plain_ruby.json
|
|
67
|
+
- bench/golden/v1/reports/rails.json
|
|
68
|
+
- bench/golden/v1/reports/rubocop_1_75_0.json
|
|
69
|
+
- bench/golden/v1/reports/self.json
|
|
70
|
+
- bench/review_queue.rb
|
|
71
|
+
- bench/run.rb
|
|
72
|
+
- bench/schema/candidate-union-v1.schema.json
|
|
73
|
+
- docs/impv_implementation_matrix.md
|
|
74
|
+
- docs/migrations/0.2.1.md
|
|
75
|
+
- docs/migrations/0.3.0.md
|
|
76
|
+
- docs/migrations/0.4.0.md
|
|
77
|
+
- docs/necropsy_performance_adr.md
|
|
78
|
+
- docs/necropsy_scope_decisions.md
|
|
79
|
+
- docs/necropsy_type_facts_adr.md
|
|
47
80
|
- exe/necropsy
|
|
81
|
+
- gemfiles/prism_min.gemfile
|
|
82
|
+
- gemfiles/prism_min.gemfile.lock
|
|
48
83
|
- lib/necropsy.rb
|
|
49
84
|
- lib/necropsy/analyzer.rb
|
|
50
85
|
- lib/necropsy/analyzers/dynamic/coverage_collector.rb
|
|
51
86
|
- lib/necropsy/analyzers/dynamic/coverage_importer.rb
|
|
52
87
|
- lib/necropsy/analyzers/dynamic/coverband_importer.rb
|
|
88
|
+
- lib/necropsy/analyzers/dynamic/coverband_payload_set.rb
|
|
89
|
+
- lib/necropsy/analyzers/dynamic/observation_policy.rb
|
|
90
|
+
- lib/necropsy/analyzers/dynamic/redis_input_limits.rb
|
|
91
|
+
- lib/necropsy/analyzers/dynamic/redis_nonblocking_io.rb
|
|
92
|
+
- lib/necropsy/analyzers/dynamic/redis_payload_loader.rb
|
|
93
|
+
- lib/necropsy/analyzers/dynamic/redis_transport.rb
|
|
94
|
+
- lib/necropsy/analyzers/dynamic/runtime_reference.rb
|
|
53
95
|
- lib/necropsy/analyzers/dynamic/trace_point_collector.rb
|
|
54
96
|
- lib/necropsy/analyzers/dynamic/trace_point_importer.rb
|
|
97
|
+
- lib/necropsy/analyzers/legacy_result_adapter.rb
|
|
55
98
|
- lib/necropsy/analyzers/static/cha.rb
|
|
56
99
|
- lib/necropsy/analyzers/static/name_resolution.rb
|
|
57
100
|
- lib/necropsy/analyzers/static/rta.rb
|
|
58
101
|
- lib/necropsy/ast_scanner.rb
|
|
59
102
|
- lib/necropsy/ast_scanner/call_recording.rb
|
|
103
|
+
- lib/necropsy/ast_scanner/call_site_creation.rb
|
|
104
|
+
- lib/necropsy/ast_scanner/definition_creation.rb
|
|
60
105
|
- lib/necropsy/ast_scanner/dsl_macros.rb
|
|
61
106
|
- lib/necropsy/ast_scanner/method_definitions.rb
|
|
62
107
|
- lib/necropsy/ast_scanner/references.rb
|
|
63
108
|
- lib/necropsy/ast_scanner/ruby_semantics.rb
|
|
64
109
|
- lib/necropsy/ast_scanner/traversal.rb
|
|
65
110
|
- lib/necropsy/ast_scanner/value_definitions.rb
|
|
111
|
+
- lib/necropsy/bench/candidate_union.rb
|
|
112
|
+
- lib/necropsy/bench/claim_gate.rb
|
|
66
113
|
- lib/necropsy/bench/evaluator.rb
|
|
114
|
+
- lib/necropsy/bench/finding_facts.rb
|
|
115
|
+
- lib/necropsy/bench/precision_gate.rb
|
|
116
|
+
- lib/necropsy/bench/release_audit.rb
|
|
117
|
+
- lib/necropsy/bench/release_audit/adversarial_runner.rb
|
|
118
|
+
- lib/necropsy/bench/release_audit/artifact_writer.rb
|
|
119
|
+
- lib/necropsy/bench/release_audit/config_validator.rb
|
|
120
|
+
- lib/necropsy/bench/release_audit/git_snapshot.rb
|
|
121
|
+
- lib/necropsy/bench/release_audit/performance_gate.rb
|
|
122
|
+
- lib/necropsy/bench/release_audit/run_provenance.rb
|
|
123
|
+
- lib/necropsy/bench/report_normalizer.rb
|
|
124
|
+
- lib/necropsy/bench/review_queue.rb
|
|
125
|
+
- lib/necropsy/bench/safety_mutation_harness.rb
|
|
126
|
+
- lib/necropsy/bench/seed_runner.rb
|
|
127
|
+
- lib/necropsy/bounded_canonicalizer.rb
|
|
67
128
|
- lib/necropsy/cache/scan_cache.rb
|
|
129
|
+
- lib/necropsy/call_site_identity.rb
|
|
68
130
|
- lib/necropsy/cli.rb
|
|
131
|
+
- lib/necropsy/clock.rb
|
|
69
132
|
- lib/necropsy/confidence/scorer.rb
|
|
70
133
|
- lib/necropsy/configuration.rb
|
|
134
|
+
- lib/necropsy/convention_rules.rb
|
|
71
135
|
- lib/necropsy/coverage_runtime.rb
|
|
136
|
+
- lib/necropsy/definition_identity.rb
|
|
137
|
+
- lib/necropsy/definition_identity/canonical_digest.rb
|
|
72
138
|
- lib/necropsy/diagnostics.rb
|
|
139
|
+
- lib/necropsy/embedded_ruby.rb
|
|
73
140
|
- lib/necropsy/entry_points/plain.rb
|
|
74
141
|
- lib/necropsy/entry_points/rails.rb
|
|
75
142
|
- lib/necropsy/entry_points/test.rb
|
|
143
|
+
- lib/necropsy/flow_interpreter.rb
|
|
144
|
+
- lib/necropsy/graph/blocker_matching.rb
|
|
76
145
|
- lib/necropsy/graph/call_graph.rb
|
|
146
|
+
- lib/necropsy/graph/definition_index.rb
|
|
147
|
+
- lib/necropsy/graph/dynamic_evidence_tracking.rb
|
|
148
|
+
- lib/necropsy/graph/evidence_store.rb
|
|
149
|
+
- lib/necropsy/graph/resolution_store.rb
|
|
150
|
+
- lib/necropsy/graph_self_check.rb
|
|
77
151
|
- lib/necropsy/guardrail/baseline.rb
|
|
78
152
|
- lib/necropsy/guardrail/diff.rb
|
|
79
153
|
- lib/necropsy/guardrail/quarantine.rb
|
|
154
|
+
- lib/necropsy/load_graph.rb
|
|
80
155
|
- lib/necropsy/models.rb
|
|
156
|
+
- lib/necropsy/performance_profiler.rb
|
|
81
157
|
- lib/necropsy/project.rb
|
|
82
158
|
- lib/necropsy/reachability/engine.rb
|
|
159
|
+
- lib/necropsy/reference_barrier.rb
|
|
83
160
|
- lib/necropsy/report.rb
|
|
84
161
|
- lib/necropsy/reporter.rb
|
|
85
162
|
- lib/necropsy/runner.rb
|
|
163
|
+
- lib/necropsy/runtime_feedback.rb
|
|
164
|
+
- lib/necropsy/semantics_matrix.rb
|
|
86
165
|
- lib/necropsy/trace_point_runtime.rb
|
|
166
|
+
- lib/necropsy/type_facts.rb
|
|
87
167
|
- lib/necropsy/version.rb
|
|
168
|
+
- lib/necropsy/why_not_explanation.rb
|
|
169
|
+
- lib/necropsy/why_not_renderer.rb
|
|
170
|
+
- lib/necropsy/world_policy.rb
|
|
171
|
+
- schema/necropsy-report-v2.schema.json
|
|
88
172
|
- script/measure.rb
|
|
89
173
|
homepage: https://github.com/ydah/necropsy
|
|
90
174
|
licenses:
|