spill 0.5.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35e0d1385fac986284c09c8f9b68e75ab46d57dfc6b6e3aac9f51b1c720b3f9c
4
- data.tar.gz: 8443105c60e089785ddd8caa8c71e9eb9f9545cd120b326d06b1230480b77544
3
+ metadata.gz: f6fdd902675c2ffbe157716d00abe7e93d7dc4baee1a326b3eda70b1ad644a04
4
+ data.tar.gz: 613d93aa6ea3ed459a63f399e5e40dbd30dbb2e34f1fcea8be099e0a57e09fa0
5
5
  SHA512:
6
- metadata.gz: 1505ec20291988b7c6a1883062c4ba5b12c27ae2a22f7a68c1094467d311ab148efd2fc66072c1b3785f65590cb85a817ed91eb4e64d7bf0216a35633227d112
7
- data.tar.gz: bedf3fb5f9061cd05a986f4c04e0013de39af5d2121fcea30a8ba589dcbe873720b97f04da8bc82632acc3d30fc014659ce61fde52d6a94e82667b51c6dd3ac9
6
+ metadata.gz: 65bddb5fa09e60ea45b901c96220519066eb7e989d559cf3f122b75f1e80cce6226835b9f020f409f533b6fcac03c22e64471c734feb0c55e40d42d964fd4dd8
7
+ data.tar.gz: 7c30a22113d054e0ebf40650036e7ca5412eea1f5a96c51e2683028f505aabe4f0714e40e5cf3a1e7ecb36933352649d490db4e9fd9c54dfe903ad682821646d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.1] - 2026-07-11
4
+
5
+ - The fact-block cap now keeps the newest facts: on a repo busy enough to
6
+ overflow the block (roughly 40+ commits in the window), it used to keep the
7
+ oldest commits and silently drop the newest ones and every GitHub fact
8
+ (merged PRs included) from the AI summary.
9
+ - Repos using git's SHA-256 object format collect commits again — the commit
10
+ parser rejected 64-character hashes, so those repos showed up as quiet.
11
+ - A commit log record with an unparseable date is now skipped on its own;
12
+ previously it could error out the whole report.
13
+
3
14
  ## [0.5.0] - 2026-07-11
4
15
 
5
16
  - Each key point may now run to three sentences (120-token cap) — enough for
data/lib/spill/briefs.rb CHANGED
@@ -18,7 +18,9 @@ module Spill
18
18
  }.freeze
19
19
 
20
20
  # The on-device model has a small context window; a block that outgrows
21
- # this budget keeps its most recent facts and says how many were cut.
21
+ # this budget keeps the facts at the end of the list the newest
22
+ # commits and all the GitHub facts, which follow them — and says how
23
+ # many earlier ones were cut.
22
24
  MAX_BODY_CHARS = 140
23
25
  MAX_BLOCK_CHARS = 3000
24
26
 
@@ -56,10 +58,10 @@ module Spill
56
58
 
57
59
  def capped(facts)
58
60
  budget = MAX_BLOCK_CHARS
59
- kept = facts.take_while { |fact| (budget -= fact.length + 1) >= 0 }
60
- kept = facts.first(1) if kept.empty?
61
+ kept = facts.reverse.take_while { |fact| (budget -= fact.length + 1) >= 0 }.reverse
62
+ kept = facts.last(1) if kept.empty?
61
63
  cut = facts.size - kept.size
62
- cut.positive? ? kept + [ "(and #{cut} more items not listed)" ] : kept
64
+ cut.positive? ? [ "(and #{cut} earlier items not listed)" ] + kept : kept
63
65
  end
64
66
 
65
67
  # A PR that was opened in the window but is still open would appear
@@ -37,12 +37,19 @@ module Spill
37
37
 
38
38
  log.split(RECORD_SEP).filter_map do |record|
39
39
  sha, date, subject, body = record.strip.split(SEP, 4)
40
- next unless sha&.match?(/\A\h{40}\z/) # a body containing our separators can't forge a record
40
+ # SHA-1 or SHA-256 repos; a body containing our separators makes
41
+ # a malformed record, not a forged commit — skip, never raise.
42
+ next unless sha&.match?(/\A(?:\h{40}|\h{64})\z/)
41
43
  next if seen[sha]
42
44
 
45
+ timestamp = begin
46
+ Time.parse(date)
47
+ rescue ArgumentError, TypeError
48
+ next
49
+ end
43
50
  seen[sha] = true
44
51
  Event.new(source: :local_git, kind: :commit, repo: name, title: subject,
45
- ref: branch, timestamp: Time.parse(date),
52
+ ref: branch, timestamp: timestamp,
46
53
  extra: { sha: sha, body: clean_body(body) })
47
54
  end
48
55
  end
data/lib/spill/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spill
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tugcem Yalcin