lumitrace 0.6.0 → 0.6.1
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/docs/ai-help.md +10 -5
- data/docs/ai-schema.md +12 -3
- data/lib/lumitrace/ai_docs.rb +21 -1
- data/lib/lumitrace/help_manifest.rb +9 -4
- data/lib/lumitrace/schema_manifest.rb +13 -3
- data/lib/lumitrace/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bbe02bbc074d7d4ef9a4279ea426500296ea6aca0b560c146140f5e143ea4f8f
|
|
4
|
+
data.tar.gz: 6d0101d97cf784392d3f62a90edfc29a244b6a6582da9b15800447d8b3ad9175
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb1c57562f18e6827bcf0f425e45ab098182553ba9f44f311f4302f8c919e133903a2dbe97695c37914ad01415709deb68445d6109ccaa1f87a3979bb5dd307a
|
|
7
|
+
data.tar.gz: 8f863f58547b5e5ab455b07857919383e2784d18dc3c32486b3ff94e84d799deae180938d4c6ef3cb94bac0a8bd8689c5caf0b9e6b11f1dc52ed8f6bcb81c936
|
data/docs/ai-help.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Lumitrace Help
|
|
4
4
|
|
|
5
|
-
- Version: 0.
|
|
5
|
+
- Version: 0.6.1
|
|
6
6
|
- Help version: 1
|
|
7
7
|
- Primary JSON entrypoint: `lumitrace help --format json`
|
|
8
8
|
- Schema JSON entrypoint: `lumitrace schema --format json`
|
|
@@ -37,11 +37,16 @@
|
|
|
37
37
|
## Key Options
|
|
38
38
|
- `--collect-mode` (default="last"; values=last,types,history)
|
|
39
39
|
- `--max-samples` (default=3; Used by history mode.)
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
40
|
+
- `-j, --json[=PATH]` (Emit JSON output.)
|
|
41
|
+
- `-h, --html[=PATH]` (Emit HTML output.)
|
|
42
|
+
- `-t, --text[=PATH]` (Emit text output.)
|
|
43
|
+
- `-g, --git-diff[=MODE]` (Restrict instrumentation to diff hunks.)
|
|
43
44
|
- `--range SPEC` (repeatable=true; Restrict instrumentation to file ranges.)
|
|
44
|
-
- `--git-diff
|
|
45
|
+
- `--git-diff-context N` (Expand diff hunks by +/-N lines.)
|
|
46
|
+
- `--git-cmd PATH` (Git executable for diff.)
|
|
47
|
+
- `--git-diff-no-untracked` (Exclude untracked files from diff.)
|
|
48
|
+
- `--root PATH` (Root directory for instrumentation.)
|
|
49
|
+
- `--verbose[=LEVEL]` (Verbose logs to stderr (level 1-3).)
|
|
45
50
|
|
|
46
51
|
## Examples
|
|
47
52
|
- `lumitrace --collect-mode history --max-samples 5 -j app.rb`
|
data/docs/ai-schema.md
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Lumitrace JSON Schema
|
|
4
4
|
|
|
5
|
-
- Version: 0.
|
|
5
|
+
- Version: 0.6.1
|
|
6
6
|
- Schema version: 1
|
|
7
|
-
- Top level:
|
|
7
|
+
- Top level: object
|
|
8
|
+
- `version` (integer) - Schema version number.
|
|
9
|
+
- `events` (array of event) - Traced expression events.
|
|
10
|
+
- `coverage` (array of coverage_entry) - Per-file coverage summary.
|
|
8
11
|
|
|
9
12
|
## Common Event Fields
|
|
10
13
|
- `file` (string, required) - Absolute source path.
|
|
@@ -14,9 +17,15 @@
|
|
|
14
17
|
- `end_col` (integer, required)
|
|
15
18
|
- `kind` (string, required)
|
|
16
19
|
- `name` (string|null, optional) - Present for kind=arg.
|
|
17
|
-
- `total` (integer, required) - Execution count.
|
|
20
|
+
- `total` (integer, required) - Execution count. 0 means the expression was never executed (uncovered).
|
|
18
21
|
- `types` (object, required) - Ruby class name => observed count.
|
|
19
22
|
|
|
23
|
+
## Coverage Entry Fields
|
|
24
|
+
- `file` (string, required) - Absolute source path.
|
|
25
|
+
- `total_lines` (integer, required) - Number of traced expression lines.
|
|
26
|
+
- `covered_lines` (integer, required) - Lines with total > 0.
|
|
27
|
+
- `coverage_percent` (float, required) - Covered / total * 100, rounded to 1 decimal.
|
|
28
|
+
|
|
20
29
|
## Value Summary Fields
|
|
21
30
|
- `type` (string, required) - Ruby class name.
|
|
22
31
|
- `preview` (string, required) - Value preview string (inspect-based).
|
data/lib/lumitrace/ai_docs.rb
CHANGED
|
@@ -70,7 +70,17 @@ module Lumitrace
|
|
|
70
70
|
lines << ""
|
|
71
71
|
lines << "- Version: #{data[:version]}"
|
|
72
72
|
lines << "- Schema version: #{data[:schema_version]}"
|
|
73
|
-
|
|
73
|
+
top = data[:json_top_level]
|
|
74
|
+
if top[:type] == "object" && top[:fields]
|
|
75
|
+
lines << "- Top level: #{top[:type]}"
|
|
76
|
+
top[:fields].each do |name, spec|
|
|
77
|
+
type_text = spec[:items] ? "#{spec[:type]} of #{spec[:items]}" : spec[:type].to_s
|
|
78
|
+
desc = spec[:description] ? " - #{spec[:description]}" : ""
|
|
79
|
+
lines << " - `#{name}` (#{type_text})#{desc}"
|
|
80
|
+
end
|
|
81
|
+
else
|
|
82
|
+
lines << "- Top level: #{top[:type]} of #{top[:items]}"
|
|
83
|
+
end
|
|
74
84
|
lines << ""
|
|
75
85
|
lines << "## Common Event Fields"
|
|
76
86
|
data[:event_common_fields].each do |name, spec|
|
|
@@ -79,6 +89,16 @@ module Lumitrace
|
|
|
79
89
|
desc = spec[:description] ? " - #{spec[:description]}" : ""
|
|
80
90
|
lines << "- `#{name}` (#{type_text}, #{req})#{desc}"
|
|
81
91
|
end
|
|
92
|
+
if data[:coverage_entry_fields]
|
|
93
|
+
lines << ""
|
|
94
|
+
lines << "## Coverage Entry Fields"
|
|
95
|
+
data[:coverage_entry_fields].each do |name, spec|
|
|
96
|
+
req = spec[:required] ? "required" : "optional"
|
|
97
|
+
type_text = Array(spec[:type]).join("|")
|
|
98
|
+
desc = spec[:description] ? " - #{spec[:description]}" : ""
|
|
99
|
+
lines << "- `#{name}` (#{type_text}, #{req})#{desc}"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
82
102
|
lines << ""
|
|
83
103
|
lines << "## Value Summary Fields"
|
|
84
104
|
data[:value_summary_fields].each do |name, spec|
|
|
@@ -56,11 +56,16 @@ module Lumitrace
|
|
|
56
56
|
key_options: [
|
|
57
57
|
{ name: "--collect-mode", values: COLLECT_MODES, default: "last" },
|
|
58
58
|
{ name: "--max-samples", type: "Integer", default: 3, note: "Used by history mode." },
|
|
59
|
-
{ name: "--json[=PATH]", type: "bool|string", note: "Emit JSON output." },
|
|
60
|
-
{ name: "--html[=PATH]", type: "bool|string", note: "Emit HTML output." },
|
|
61
|
-
{ name: "--text[=PATH]", type: "bool|string", note: "Emit text output." },
|
|
59
|
+
{ name: "-j, --json[=PATH]", type: "bool|string", note: "Emit JSON output." },
|
|
60
|
+
{ name: "-h, --html[=PATH]", type: "bool|string", note: "Emit HTML output." },
|
|
61
|
+
{ name: "-t, --text[=PATH]", type: "bool|string", note: "Emit text output." },
|
|
62
|
+
{ name: "-g, --git-diff[=MODE]", type: "string", note: "Restrict instrumentation to diff hunks." },
|
|
62
63
|
{ name: "--range SPEC", type: "string", repeatable: true, note: "Restrict instrumentation to file ranges." },
|
|
63
|
-
{ name: "--git-diff
|
|
64
|
+
{ name: "--git-diff-context N", type: "Integer", note: "Expand diff hunks by +/-N lines." },
|
|
65
|
+
{ name: "--git-cmd PATH", type: "string", note: "Git executable for diff." },
|
|
66
|
+
{ name: "--git-diff-no-untracked", type: "bool", note: "Exclude untracked files from diff." },
|
|
67
|
+
{ name: "--root PATH", type: "string", note: "Root directory for instrumentation." },
|
|
68
|
+
{ name: "--verbose[=LEVEL]", type: "Integer", note: "Verbose logs to stderr (level 1-3)." }
|
|
64
69
|
],
|
|
65
70
|
outputs: [
|
|
66
71
|
{ kind: "json", default_path: "lumitrace_recorded.json" },
|
|
@@ -9,8 +9,18 @@ module Lumitrace
|
|
|
9
9
|
tool: "lumitrace",
|
|
10
10
|
version: VERSION,
|
|
11
11
|
json_top_level: {
|
|
12
|
-
type: "
|
|
13
|
-
|
|
12
|
+
type: "object",
|
|
13
|
+
fields: {
|
|
14
|
+
version: { type: "integer", description: "Schema version number." },
|
|
15
|
+
events: { type: "array", items: "event", description: "Traced expression events." },
|
|
16
|
+
coverage: { type: "array", items: "coverage_entry", description: "Per-file coverage summary." }
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
coverage_entry_fields: {
|
|
20
|
+
file: { type: "string", required: true, description: "Absolute source path." },
|
|
21
|
+
total_lines: { type: "integer", required: true, description: "Number of traced expression lines." },
|
|
22
|
+
covered_lines: { type: "integer", required: true, description: "Lines with total > 0." },
|
|
23
|
+
coverage_percent: { type: "float", required: true, description: "Covered / total * 100, rounded to 1 decimal." }
|
|
14
24
|
},
|
|
15
25
|
event_common_fields: {
|
|
16
26
|
file: { type: "string", required: true, description: "Absolute source path." },
|
|
@@ -20,7 +30,7 @@ module Lumitrace
|
|
|
20
30
|
end_col: { type: "integer", required: true },
|
|
21
31
|
kind: { type: "string", required: true, enum: %w[expr arg] },
|
|
22
32
|
name: { type: ["string", "null"], required: false, description: "Present for kind=arg." },
|
|
23
|
-
total: { type: "integer", required: true, description: "Execution count." },
|
|
33
|
+
total: { type: "integer", required: true, description: "Execution count. 0 means the expression was never executed (uncovered)." },
|
|
24
34
|
types: {
|
|
25
35
|
type: "object",
|
|
26
36
|
required: true,
|
data/lib/lumitrace/version.rb
CHANGED