bootprint 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ae8e01ef715b2bb8a62bedb57882a0cf2af5a783ff72c15673b46ecabbff4ea
4
- data.tar.gz: a5c4b0fbf1d54ff4c65b0e338d1e117f6eaaf2d1f5c2f1a558824441af5cdca8
3
+ metadata.gz: 84278443cdd38e08c4b03bdd0776b8a9b7fd32a623b5ebf2f2c3e1ddc29901c2
4
+ data.tar.gz: e51b0d1b314473e6acb15544ab81a9fbd09de46994f929eff9b5751769db3f80
5
5
  SHA512:
6
- metadata.gz: d536be2a2d5cd4059b6572736b555b2c2d4ddeaea2245f229dcca4d3d1e1d1726d7e35f4cc04a2b012c19212c8f32b31bb6fccbcc0a249ad152cccd475078123
7
- data.tar.gz: 9d973eb86bcb2c82451af1799e80426fe17174b7b269d7bc75fb228e10027cd1d80f76866724935491a573f40d2d2cfeeac121e80f93d69fc06853ca4beb699c
6
+ metadata.gz: e3be35d8bc8b7d970b4239b987fef35361677e8347fc24c200db57118515ebc2be83691c371f892b1d47a4fcf05cfd6b408c453282f117b5d3cec28ee1702c76
7
+ data.tar.gz: 1a99662465a2ef9d867b4e81016d4ce92c0c02ca949d2a6425e30c26ee223739a976f941e12162c432e53dca052f79be668f0ce29ca67a57abf329dba1d5a473
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to Bootprint are documented here. The project follows Semant
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.5.0 - 2026-08-14
8
+
9
+ ### Added
10
+
11
+ - Capture timezone, default encodings, and locale metadata on the operating-system fingerprint.
12
+ - Built-in rules `timezone-drift`, `encoding-drift`, and `locale-drift` for those fields.
13
+
7
14
  ## 0.4.0 - 2026-08-11
8
15
 
9
16
  ### Added
data/README.md CHANGED
@@ -56,7 +56,7 @@ Bootprint 0.2 combines a dependency compatibility analyzer, Rails boot inspector
56
56
 
57
57
  `Gemfile.lock` captures dependency resolution, but not the complete runtime contract. Ruby engine and patch level, native clients, libc, CPU architecture, Rails adapters, required configuration, filesystem behavior, and initializer ordering can all change application behavior.
58
58
 
59
- Bootprint records those facts as deterministic schema-v2 JSON and evaluates them with 39 independently testable built-in rules. A finding answers four questions that a plain diff cannot:
59
+ Bootprint records those facts as deterministic schema-v2 JSON and evaluates them with 42 independently testable built-in rules. A finding answers four questions that a plain diff cannot:
60
60
 
61
61
  1. What changed?
62
62
  2. How dangerous is it?
@@ -79,7 +79,7 @@ ERROR Required environment variable is missing
79
79
 
80
80
  | Capability | Bootprint 0.2 |
81
81
  |---|---|
82
- | Diagnostic knowledge | 39 built-in rules across runtime, dependencies, native libraries, configuration, filesystem, and Rails boot |
82
+ | Diagnostic knowledge | 42 built-in rules across runtime, dependencies, native libraries, configuration, filesystem, locale, and Rails boot |
83
83
  | Severity model | `info`, `warning`, `error`, `critical` |
84
84
  | Report formats | Human terminal output, JSON, SARIF 2.1, Markdown |
85
85
  | Snapshot contract | Deterministic schema v2 with in-memory v1 migration |
@@ -97,6 +97,7 @@ ERROR Required environment variable is missing
97
97
  | Native libraries | OpenSSL, libyaml, SQLite, PostgreSQL, MySQL, libc, compiler and header availability when detectable |
98
98
  | Configuration | Environment-variable names and presence, Rails environment, adapters, framework settings |
99
99
  | Filesystem | Temporary/log path availability, writability, path separators, case sensitivity, symlink behavior |
100
+ | Locale | Timezone name and UTC offset, default internal/external encodings, LANG / LC_ALL / charmap |
100
101
  | Rails boot | Framework configuration, autoload/eager-load paths, initializers, and opt-in initializer timings |
101
102
  | Docker | Image runtime, platforms, installed package metadata when available, workdir, entrypoint, command, permissions |
102
103
 
data/lib/bootprint/cli.rb CHANGED
@@ -436,7 +436,7 @@ module Bootprint
436
436
  raise OptionParser::InvalidArgument, "NAME may contain only letters, numbers, dots, underscores, and hyphens" unless valid
437
437
  end
438
438
 
439
- def safe_name(value) = value.to_s.gsub(/[^a-zA-Z0-9_.-]+/, "-").gsub(/\A-+|-+\z/, "")
439
+ def safe_name(value) = value.to_s.gsub(/[^a-zA-Z0-9_.-]+/, "-").gsub(/\A-++|-++\z/, "")
440
440
 
441
441
  def reject_extra_arguments!
442
442
  raise OptionParser::ParseError, "unexpected arguments: #{@argv.join(' ')}" unless @argv.empty?
@@ -19,7 +19,10 @@ module Bootprint
19
19
  "processors" => Etc.nprocessors,
20
20
  "capabilities" => TOOLS.to_h { |tool| [tool, executable?(tool)] },
21
21
  "ruby_headers" => header_state,
22
- "ci" => ci_provider
22
+ "ci" => ci_provider,
23
+ "timezone" => timezone_state,
24
+ "encoding" => encoding_state,
25
+ "locale" => locale_state
23
26
  }
24
27
  end
25
28
 
@@ -45,6 +48,30 @@ module Bootprint
45
48
 
46
49
  nil
47
50
  end
51
+
52
+ def timezone_state
53
+ now = Time.now
54
+ {
55
+ "name" => now.zone,
56
+ "utc_offset" => now.utc_offset,
57
+ "tz" => ENV.fetch("TZ", nil)
58
+ }
59
+ end
60
+
61
+ def encoding_state
62
+ {
63
+ "external" => Encoding.default_external.name,
64
+ "internal" => Encoding.default_internal&.name
65
+ }
66
+ end
67
+
68
+ def locale_state
69
+ {
70
+ "lang" => ENV.fetch("LANG", nil),
71
+ "lc_all" => ENV.fetch("LC_ALL", nil),
72
+ "charmap" => Encoding.locale_charmap
73
+ }
74
+ end
48
75
  end
49
76
  end
50
77
  end
@@ -58,6 +58,24 @@ module Bootprint
58
58
  fix: "Use a standard release build for production.") do |_source, target|
59
59
  dig(target, "runtime.debug_build") == true && { "description" => dig(target, "runtime.description") }
60
60
  end
61
+ rule("timezone-drift", "Timezone mismatch", :runtime, :warning,
62
+ cause: "The environments select different timezones.",
63
+ impact: "Time.now, cron, and timestamp formatting can disagree across machines.",
64
+ fix: "Set TZ consistently in local, container, and CI environments.") do |source, target|
65
+ difference(source, target, "operating_system.timezone")
66
+ end
67
+ rule("encoding-drift", "Default encoding mismatch", :runtime, :warning,
68
+ cause: "Ruby default encodings differ between environments.",
69
+ impact: "String transcoding, file IO, and JSON payloads can fail only in one environment.",
70
+ fix: "Align Encoding.default_external (and LANG/LC_ALL) with the deployment runtime.") do |source, target|
71
+ difference(source, target, "operating_system.encoding")
72
+ end
73
+ rule("locale-drift", "Locale mismatch", :runtime, :info,
74
+ cause: "LANG / LC_ALL / locale charmap differ between environments.",
75
+ impact: "Sort order, number formatting, and encoding defaults can change.",
76
+ fix: "Export the same LANG and LC_ALL in every environment.") do |source, target|
77
+ difference(source, target, "operating_system.locale")
78
+ end
61
79
  end
62
80
 
63
81
  def dependency_rules
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootprint
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnexis