Skip to content
Merged

v3.0.2 #1108

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
460c0d5
fix(store): a replaced splayed table keeps one copy of itself (#713)
singaraiona Oct 5, 2026
b3c8222
Merge pull request #714 from RayforceDB/feat/splay-retention-713
singaraiona Oct 5, 2026
6537eb3
fix(query): exclude null symbols from not-in (#739)
singaraiona Oct 8, 2026
00f5ea8
Merge pull request #742 from RayforceDB/fix/739-sym-not-in-nulls
singaraiona Oct 8, 2026
21e0d0c
perf(index): store hash slot table and group offsets as 32-bit
ser-vasilich Oct 6, 2026
506bc68
fix(heap): count off-heap allocations toward the spill watermark (#712)
ser-vasilich Oct 6, 2026
8e9b7d7
perf(index): store hash index row ids as 32-bit
ser-vasilich Oct 6, 2026
46c0608
fix(arena): grow chunks so a large arena can spill (#712)
ser-vasilich Oct 6, 2026
b00e1fe
fix(index): keep the wide arrays when narrowing is interrupted
ser-vasilich Oct 6, 2026
2883f55
fix(heap): hand memory back between statements when it is short
ser-vasilich Oct 7, 2026
13bcf74
perf(index): build hash indexes partition by partition within the mem…
ser-vasilich Oct 7, 2026
32f338c
fix(heap): relieve only when it brings the footprint back under the w…
ser-vasilich Oct 8, 2026
433c85c
Merge pull request #745 from RayforceDB/perf/hash-index-build
singaraiona Oct 8, 2026
e767c04
Merge pull request #746 from RayforceDB/fix/heap-watermark-712
singaraiona Oct 8, 2026
06a7b56
perf(scan): read ahead the columns a pass reads on cold storage (#747)
ser-vasilich Oct 8, 2026
9c76c90
fix(store): a reader keeps up with a table that is being rewritten (#…
ser-vasilich Oct 8, 2026
d02757c
perf(parquet): import column by column when memory is short, through …
ser-vasilich Oct 8, 2026
0fe8318
perf(query): isolate sparse group-count worker slices (#741)
singaraiona Oct 8, 2026
57f5cfe
fix(query): compare ordered symbols by lexical value (#743)
singaraiona Oct 8, 2026
24c14e8
perf(query): compose safe nested selects before planning (#754)
singaraiona Oct 8, 2026
f91f52f
fix(query): align membership, concat, and grouped fallback semantics …
singaraiona Oct 10, 2026
676c2f0
fix(query): sort and take a no-output grouping on a computed key (#772)
ser-vasilich Oct 11, 2026
869ded1
perf(import): bound parquet symbol import and splayed hash-index I/O …
ser-vasilich Oct 11, 2026
86bc380
fix(eval): closure scoping, eval windows and key purity (#777)
ser-vasilich Oct 11, 2026
d17dfbc
fix(heap): relieve memory on evidence of a spill, discard parked spil…
ser-vasilich Oct 11, 2026
16f9401
perf(store): reuse unchanged partitions across parted mounts (#761)
singaraiona Oct 11, 2026
92e37db
fix(store): release unused partition domains before splayed I/O (#782)
singaraiona Oct 11, 2026
1789a4d
fix(test): read pf_sink so clang accepts test_pool.c (#775)
vbmithr Oct 12, 2026
5c4dde9
fix(query): a multi-key select with a distinct count beside an expres…
singaraiona Oct 12, 2026
c5f2765
fix(query): release the filter result in the count-distinct rewrite (…
ihrfv Oct 12, 2026
43b9941
fix: empty-left in answers B8; balance sys-mapped on map and unmap (#…
ser-vasilich Oct 12, 2026
b5a813a
fix: string membership in and out of queries; null equality across ty…
ser-vasilich Oct 12, 2026
a9f0ab2
fix(test): drop a late _POSIX_C_SOURCE define in test_link.c (#774)
vbmithr Oct 13, 2026
6e13d19
fix(app): validate CLI integers and cap worker count (#793)
belowzeroff Oct 13, 2026
060c273
fix(log): reject arguments to snapshot and sync (#795)
belowzeroff Oct 13, 2026
902c851
fix(datalog): finalize owned programs and guard serialization (#797)
belowzeroff Oct 13, 2026
7911350
fix(system): reject arguments to read-only introspection calls (#798)
belowzeroff Oct 13, 2026
6a77363
test(app): cover CLI argument errors (#799)
belowzeroff Oct 13, 2026
6f07156
build: scope section GC flags to static library (#804)
belowzeroff Oct 13, 2026
de67240
fix(pool): run tasks past the ring in further rounds of the same grai…
ser-vasilich Oct 13, 2026
4a0250c
fix(sort,window,group): unsigned key spans, numeric F64 composite ord…
ser-vasilich Oct 13, 2026
bb43a73
docs(readme): document embedding as a static library (#783)
phillc73 Oct 13, 2026
2f4605b
fix(group,query): parted STR/LIST group merge; composite keys at full…
ser-vasilich Oct 13, 2026
a9c5bdc
fix(group): parted avg/var over nulls, binary-agg second operand, key…
ser-vasilich Oct 14, 2026
f569750
fix(eval): print an uncaught raise's value, rendered lazily and bound…
vbmithr Oct 14, 2026
835f15f
fix(lang): implement multi-branch if in both evaluators (#812)
vbmithr Oct 14, 2026
7524357
docs: name resolution in queries; take cycles (#817)
vbmithr Oct 14, 2026
7ff58fd
fix(domain): abort cancelled batch interns before commit (#825)
belowzeroff Oct 14, 2026
ad90f6a
fix(query): sort, take, format and serialize parted tables in place (…
ser-vasilich Oct 14, 2026
6006083
fix(domain): free the superseded generation at reopen instead of reti…
ihrfv Oct 14, 2026
13606f2
feat(lang): indexed times, (times [i n] body...) (#827)
vbmithr Oct 14, 2026
9720da0
fix(collection): at keeps a typed vector's type for any integer index…
vbmithr Oct 14, 2026
4a29db4
fix(cmp): comparisons and and/or/not work element-wise on a LIST (#830)
vbmithr Oct 14, 2026
3646332
fix(cmp): dyadic min/max give the operands' promoted type; LIST resul…
vbmithr Oct 14, 2026
0ae4495
fix(dict): release distinct error values on failure (#834)
belowzeroff Oct 16, 2026
233cd34
fix(sys): skip memory flag value in .sys.args (#835)
belowzeroff Oct 16, 2026
be19c86
fix(compile): preserve signed zero in constant pool (#836)
belowzeroff Oct 16, 2026
94a77ee
fix(collection): reverse tables and dictionaries (#837)
belowzeroff Oct 16, 2026
c9d863d
fix(query,group): parted where/take/group fixes; column-free aggregat…
ser-vasilich Oct 16, 2026
74a9f18
fix(alter): amend a dotted target in place when its dict chain is sol…
vbmithr Oct 16, 2026
d91801f
fix(group): sort nullable min groups after aggregation (#843)
belowzeroff Oct 16, 2026
313f191
fix(group): avoid raw-sum ranking for affine top-N (#844)
belowzeroff Oct 16, 2026
a436b3f
perf(sort): reuse already ordered select input (#847)
belowzeroff Oct 16, 2026
2faf4b3
test(heap): measure discarded spill pages against the dirty ones (#857)
ser-vasilich Oct 16, 2026
3e48d55
fix(hof): map, fold and scan box a typed vector one element at a time…
vbmithr Oct 16, 2026
65a8a3e
perf(join): use asof index for null-free symbol keys (#848)
belowzeroff Oct 16, 2026
cc6236b
fix(alter): reject local targets before global writes (#846)
belowzeroff Oct 16, 2026
364cc1b
fix(build): select clang by default and test clang 23 in CI (#845)
belowzeroff Oct 16, 2026
9299821
fix(csv,splay): a cancelled splayed write publishes nothing (#860)
ser-vasilich Oct 16, 2026
2287056
fix(group): affine sum bias counts the non-null rows (#861)
ser-vasilich Oct 16, 2026
93ff47e
fix(store,collection): LIST cells keep inner nulls and GUIDs, table/d…
ser-vasilich Oct 16, 2026
17120ae
fix(query): eval-level grouping over parted tables, by-dict aliases a…
ser-vasilich Oct 17, 2026
eea553d
test: pool read-ahead and pty master-close tests hold on older kernel…
ser-vasilich Oct 17, 2026
0462f4b
perf(env): answer a dotted name's flat global lookup from a slot filt…
vbmithr Oct 17, 2026
ebae11c
fix(format): print a null symbol as ', not null (#872)
vbmithr Oct 17, 2026
9f8e6c3
fix(collection): take rows from a parted table handle (#867)
belowzeroff Oct 17, 2026
03ba8bf
fix(timeit): materialize a lazy result inside the timed span (#868)
belowzeroff Oct 17, 2026
237a982
fix(mem): free nested containers without recursing per level (#874)
ser-vasilich Oct 17, 2026
2129b8a
fix(build): rebuild the build-info objects when the version or date c…
vbmithr Oct 17, 2026
877ab84
fix(atom): keep a DATE or TIME atom within 32 bits, as its vector cel…
vbmithr Oct 17, 2026
72864a8
fix(parse): read a time literal's fraction as a decimal fraction of a…
vbmithr Oct 18, 2026
a1270d0
fix(store): never follow a link when removing what the store cleans u…
belowzeroff Oct 18, 2026
a6c52dc
perf(csr): build adjacency lists by counting sort instead of sorting …
morsel-ray Oct 18, 2026
d673759
fix(numparse): apply a parsed float's sign through its bits, not FP n…
morsel-ray Oct 18, 2026
1b6ba06
docs(sys): document every .sys.mem key (#890)
belowzeroff Oct 18, 2026
7b743a5
fix(query): decline unary numeric DAG ops on types their builtins rej…
belowzeroff Oct 18, 2026
8831906
fix(group): break top-N ties on first source row (#892)
belowzeroff Oct 18, 2026
ca13d6b
fix(group): strlen sum/avg skip the empty string on every route (#888)
ser-vasilich Oct 18, 2026
388265e
fix(query): sorted, taken and parted routes honour a lambda local tha…
ser-vasilich Oct 18, 2026
524de52
test(heap): check the spill discard where a punch cancels no writes (…
belowzeroff Oct 18, 2026
20e04bc
perf(csr): count and scatter edges on the pool when building a CSR (#…
morsel-ray Oct 19, 2026
8159bfc
fix(query): free the count-distinct where-sample chunk list once (#899)
morsel-ray Oct 19, 2026
96e1915
perf(query): keep integer rounding in the select DAG (#896)
belowzeroff Oct 19, 2026
424aa5c
fix(lang): parse F32 and GUID nulls and align F32 casting and printin…
vbmithr Oct 19, 2026
9c3d581
fix(exec): finalize parallel null flags only after workers join (#903)
morsel-ray Oct 19, 2026
9d3c69a
feat(store): add generation-2 compressed columns
singaraiona Oct 19, 2026
744116d
fix(query): preserve WHERE predicate row domains (#908)
morsel-ray Oct 19, 2026
d8cf73c
docs(query): explain filter domain barriers and static ranking (#909)
morsel-ray Oct 19, 2026
c9951bf
perf(group): batch staged SYM strlen accumulation (#910)
morsel-ray Oct 19, 2026
cbeb9ec
perf(query): take split WHERE rows without a full gather (#907)
ihrfv Oct 20, 2026
8560198
fix(cast): return ordinary BOOL and U8 values for null inputs (#913)
vbmithr Oct 20, 2026
8e2ece3
fix(query): decline temporal div and mod in the select DAG (#906)
belowzeroff Oct 20, 2026
67b3c46
test(mem): replace caller-heap fallback peak proxy with scoped oracle…
morsel-ray Oct 20, 2026
d199ae5
feat(lang): add q-style F32 literals (#911)
vbmithr Oct 20, 2026
631ad80
test(opt): exercise subset invariance on copied row subsets (#914)
morsel-ray Oct 20, 2026
555263a
fix(exec): isolate whole-row reader input domains (#916)
ihrfv Oct 20, 2026
0ea94d2
perf(vec): avoid double rounding bulk growth payloads (#925)
morsel-ray Oct 20, 2026
6464599
feat(lang): add nanosecond timespan values (#917)
vbmithr Oct 20, 2026
a58713b
perf(vec): keep sizing off reserved-capacity single appends (#938)
morsel-ray Oct 21, 2026
bda2f21
fix(graph): decline mixed symbol equality operands (#928)
morsel-ray Oct 21, 2026
f35b859
fix(xbar): a null atom gives a typed null (#931)
belowzeroff Oct 22, 2026
d9eead4
fix(expr): a zero divisor gives a null in fused arithmetic (#932)
belowzeroff Oct 22, 2026
5f44d2d
fix(group): keep the F64 type of a whole-number float bias in sum and…
belowzeroff Oct 22, 2026
d7153e7
perf(sort): rank symbols before parallel sortedness checks (#937)
vbmithr Oct 22, 2026
b0b0a1b
perf(query): avoid repeated parted metadata walks (#936)
morsel-ray Oct 22, 2026
5f6e619
fix(sort): use 32-bit TIME in sortedness shortcut (#939)
morsel-ray Oct 22, 2026
f7b23ec
perf(join): retain left columns for identity output mappings (#943)
vbmithr Oct 22, 2026
02804c3
perf(join): skip speculative hashing for minimum chained tables (#942)
morsel-ray Oct 22, 2026
014b98a
fix(cast): reject non-atom results in flat STR casts (#927)
morsel-ray Oct 22, 2026
62d9bff
perf(pool): size the default pool from the CPUs the process may run o…
ser-vasilich Oct 22, 2026
d4899d9
docs(pmap): describe sequential callbacks and kernel parallelism (#949)
morsel-ray Oct 23, 2026
1c86992
fix(strop): handle delimiters longer than split input (#953)
belowzeroff Oct 23, 2026
6eb7a61
perf(env): index global binding writes by symbol (#955)
vbmithr Oct 23, 2026
b30a594
perf: memory bounds on small machines, wide dense grouping, compresse…
ser-vasilich Oct 23, 2026
4529eb3
fix(enlist): restrict float promotion to I64/F64 atoms (#965)
morsel-ray Oct 23, 2026
c121003
fix(collection): return B8 for symbol prior comparisons (#967)
morsel-ray Oct 23, 2026
9956b0f
fix(arith): promote both integer atom subtraction operands (#979)
morsel-ray Oct 23, 2026
4c120ce
fix(query): distinguish dyadic minmax from reductions (#980)
morsel-ray Oct 24, 2026
d9f9ab6
fix(agg): compute TIMESPAN medians through rank kernels (#982)
morsel-ray Oct 24, 2026
580b1b2
chore(release): reconcile master ancestry for v3.0.1
morsel-ray Oct 24, 2026
2be297f
chore(release): reconcile master ancestry for v3.0.1 (#985)
morsel-ray Oct 24, 2026
5937b82
ci: pin NDEBUG checks to portable x86-64 target (#986)
morsel-ray Oct 24, 2026
32360ba
fix(collection): allow long string concatenation (#983)
belowzeroff Oct 24, 2026
65de9fe
fix(compile): isolate private loop slots from eval scopes (#995)
morsel-ray Oct 24, 2026
2d878b8
feat(api): export the anon watermark in include/rayforce.h (#996)
vbanas Oct 24, 2026
36515af
perf(store): index the parted cache; RAY_PART_CACHE_MAX sizes it (#997)
vbanas Oct 24, 2026
0c6f235
feat(store): a .db.splayed.set option that writes no automatic index …
vbanas Oct 25, 2026
cca6c45
fix(query): transport literal keyless quantile probabilities (#1000)
morsel-ray Oct 25, 2026
768e9b4
ci(release): surface failed Homebrew tap updates (#1001)
morsel-ray Oct 25, 2026
ea03a23
perf(journal): write a small frame with one write(2) instead of two (…
belowzeroff Oct 25, 2026
e463902
feat(heap): let (.sys.gc 1) run the idle decay's sweep now (#999)
vbanas Oct 25, 2026
2557601
fix(store): name the .sym symbol file in the missing-symfile error (#…
belowzeroff Oct 25, 2026
71c2943
fix(temporal): make date and timestamp 'local follow the time zone (#…
belowzeroff Oct 25, 2026
43a8d19
feat(ipc): expose the auto-journal eval scope as ray_ipc_set_auto_jou…
belowzeroff Oct 25, 2026
e235442
perf(store): encode a column's generation-2 chunks in parallel (#1021)
ser-vasilich Oct 26, 2026
b94d01a
fix(alter): write STR cells in alter set (#1023)
belowzeroff Oct 26, 2026
cd96204
fix(insert): append to an F32 column (#1016)
belowzeroff Oct 26, 2026
a3866b3
fix(env): let a dotted set shadow a builtin like a plain set (#1027)
belowzeroff Oct 26, 2026
545e814
fix(vec): detach slices before element writes (#1034)
morsel-ray Oct 26, 2026
8b505ac
perf(parquet): keep generation-2 raw payloads off storage (#1028)
ser-vasilich Oct 27, 2026
a99f0a4
test(query): symbol orderings compare text over a parted table (#1029)
ihrfv Oct 27, 2026
5bb33bd
feat(ipc): expose the auto-journal scope to Rayfall as (.ipc.auto_jou…
belowzeroff Oct 27, 2026
9805dba
fix(vec): detach slices before append and insertion (#1039)
morsel-ray Oct 27, 2026
83bc487
perf(group): read row selections directly; fix(at): read a parted tab…
ser-vasilich Oct 27, 2026
9fed984
test(splay): make generation retry cancellation deterministic (#1047)
morsel-ray Oct 27, 2026
ae63040
perf(join): gather only the columns a select reads, and as-of output …
ser-vasilich Oct 28, 2026
c9171d3
perf(find): interleave sparse sorted I64 exact lookups (#1048)
morsel-ray Oct 28, 2026
e8d750b
fix(timer): honour a timer deleting itself from its own callback (#1050)
belowzeroff Oct 28, 2026
e3adfe9
perf(query): count, first and take of a select without gathering ever…
ser-vasilich Oct 29, 2026
31fc79a
perf(query): parallel finishing stages for groupings, count-distinct …
ser-vasilich Oct 29, 2026
5ca4d91
perf: zero large blocks on the pool; grow fused count-distinct tables…
ser-vasilich Oct 29, 2026
784712e
perf(topk): prune a SYM sort key's chunks and vectors on string-prefi…
ser-vasilich Oct 30, 2026
1d27830
perf(group): count groupings over runs of equal keys (#1061)
ser-vasilich Oct 30, 2026
6ff91e9
docs(language): explain name resolution and scope (#1062)
belowzeroff Oct 30, 2026
41ba13f
fix(store): compact sliced string pools on splayed save (#1064)
belowzeroff Oct 30, 2026
df5b13c
fix(build): take the version from the highest release tag, not HEAD's…
singaraiona Oct 30, 2026
549f51e
fix(store): preserve unique marker on splayed string columns (#1063)
belowzeroff Oct 30, 2026
46cf7cd
fix(eval): keep wide atomic results in typed vectors (#1065)
belowzeroff Oct 30, 2026
9119490
fix(cast): return a GUID vector unchanged for as 'GUID (#1015)
belowzeroff Oct 30, 2026
c26f985
fix(release): retain detailed changelogs after squash (#1040)
morsel-ray Oct 30, 2026
3425644
perf(guid): compare and probe GUID vectors without boxing each cell (…
vbanas Oct 31, 2026
bc9a875
docs: remove plan documents from the tree
singaraiona Oct 31, 2026
bf9df01
build: demote clang's avx10 feature-promotion warning when the option…
belowzeroff Oct 31, 2026
7a91b29
fix(collection): return scalar for string membership in lists (#1038)
belowzeroff Oct 31, 2026
36a71fb
build: install-headers target for C clients (#849) (#1055)
phillc73 Oct 31, 2026
12bdfb7
audit: remove remediation plan documents from the tree
singaraiona Oct 31, 2026
0a72863
feat(hof): collect homogeneous map results in typed vectors (#968)
vbmithr Oct 31, 2026
578a6de
fix(format): escape strings in compact output (#1066)
belowzeroff Oct 31, 2026
a3b93f7
fix(string): make str-find a literal substring search (#1052)
belowzeroff Oct 31, 2026
b7b9492
perf(count-distinct): skip runs and scale partitions with the column …
ser-vasilich Oct 31, 2026
5c64676
feat(lang): support local targets in quoted mutators (#954)
vbmithr Nov 1, 2026
3efd08c
feat(eval): a try handler gets {code msg} for an engine error, not 0 …
vbanas Nov 2, 2026
25a0efe
fix(store): reject same-size symfile replacement (#1085)
belowzeroff Nov 3, 2026
824b977
fix(query): preserve bound keyless quantile probabilities (#1069)
belowzeroff Nov 4, 2026
66156b3
feat(ipc): move a connection to shared-memory rings on one host and t…
singaraiona Nov 4, 2026
57e27cd
fix(ipc): reject oversized serialized payloads before framing (#1101)
morsel-ray Nov 5, 2026
be55346
perf: read cold FILE-SYM dictionaries in position order (#1092)
ser-vasilich Nov 5, 2026
9853fbc
fix(store): read a SYM column's string prefixes once, in position ord…
ser-vasilich Nov 5, 2026
eeb4779
feat(log): expose the journal state to Rayfall as (.log.status) (#1096)
belowzeroff Nov 5, 2026
1cef199
ci(static-analysis): clear the 2.19 analyser baseline (#1099)
singaraiona Nov 5, 2026
b80e135
fix(cmp): normalize scalar logical results (#1103)
belowzeroff Nov 5, 2026
79029af
perf(parquet): faster column encoding on import (#1104)
ser-vasilich Nov 5, 2026
28e4c29
chore: merge master back into dev after the v3.0.1 release (#1108)
singaraiona Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 4 additions & 50 deletions .github/release-notes.sh
Original file line number Diff line number Diff line change
@@ -1,52 +1,6 @@
#!/usr/bin/env bash
# Generate a FEATURE-oriented changelog for a release, not a contributor ledger.
#
# Buckets conventional-commit subjects (feat/fix/perf/docs/...) since the
# previous release tag into readable sections. Author names and PR-merge noise
# are intentionally dropped — the "Full changelog" compare link at the bottom is
# the exhaustive, per-commit view for anyone who wants it.
#
# Usage: release-notes.sh <X.Y.Z> <target-sha>
# Writes the notes (Markdown) to stdout. Requires full git history + tags
# (checkout with fetch-depth: 0).
# Compatible interface: release-notes.sh X.Y.Z <artifact-sha> [source-sha] [--allow-direct-merge]
# Optional source pin also accepted as RELEASE_SOURCE_SHA. Requires full history,
# tags, and gh read access for historical release provenance (never moving dev).
set -euo pipefail

VERSION="${1:?usage: release-notes.sh X.Y.Z <target-sha>}"
SHA="${2:?usage: release-notes.sh X.Y.Z <target-sha>}"
REPO="${GITHUB_REPOSITORY:-RayforceDB/rayforce}"

# Previous-release boundary: the highest semver tag strictly below this release.
# Falls back to the pre-v2 rollup marker, then to the repo root (no boundary).
prev="$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -vxF "v$VERSION" | head -1 || true)"
if [ -z "$prev" ] && git rev-parse -q --verify "pre-v2-rollup^{commit}" >/dev/null 2>&1; then
prev="pre-v2-rollup"
fi
range="${prev:+$prev..}$SHA"

feats=""; fixes=""; perfs=""; docs=""; other=""
while IFS= read -r s; do
[ -n "$s" ] || continue
type="$(printf '%s' "$s" | sed -nE 's/^([a-zA-Z]+)(\([^)]*\))?!?:.*/\1/p')"
desc="$(printf '%s' "$s" | sed -E 's/^[a-zA-Z]+(\([^)]*\))?!?:[[:space:]]*//')"
case "$type" in
feat) feats+="- ${desc}"$'\n';;
fix) fixes+="- ${desc}"$'\n';;
perf) perfs+="- ${desc}"$'\n';;
docs) docs+="- ${desc}"$'\n';;
*) other+="- ${s}"$'\n';; # non-conventional / internal: keep full subject
esac
done < <(git log --no-merges --reverse --pretty=tformat:'%s' "$range")

emit() { [ -n "$2" ] && printf '### %s\n\n%s\n' "$1" "$2"; return 0; }

emit "✨ Features" "$feats"
emit "🐛 Bug fixes" "$fixes"
emit "⚡ Performance" "$perfs"
emit "📚 Documentation" "$docs"
if [ -n "$other" ]; then
printf '<details>\n<summary>🔧 Maintenance &amp; internal</summary>\n\n%s\n</details>\n' "$other"
fi

if [ -n "$prev" ]; then
printf '\n**Full changelog**: https://github.com/%s/compare/%s...v%s\n' "$REPO" "$prev" "$VERSION"
fi
exec python3 "$(dirname "${BASH_SOURCE[0]}")/release_notes.py" "$@"
237 changes: 237 additions & 0 deletions .github/release_notes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
#!/usr/bin/env python3
"""Release subjects from verified source history, independently of artifact history.

Requires local full history/tags and gh read access. Never fetches a moving branch.
Missing source objects must be fetched explicitly by the caller before retrying.
"""
import argparse
import json
import os
import re
import subprocess
import sys


class NotesError(Exception):
pass


def run(args):
proc = subprocess.run(args, text=True, capture_output=True)
if proc.returncode:
raise NotesError(f"{' '.join(args)} failed ({proc.returncode}): {proc.stderr.strip()}")
return proc.stdout.strip()


def git(*args):
return run(['git', *args])


def version(value):
if not re.fullmatch(r'[0-9]+\.[0-9]+\.[0-9]+', value):
raise NotesError(f'Invalid release version: {value!r}; expected X.Y.Z')
return tuple(map(int, value.split('.')))


def commit(ref):
return git('rev-parse', '--verify', ref + '^{commit}')


def immutable(sha):
if not isinstance(sha, str) or not re.fullmatch(r'[0-9a-f]{40}', sha):
raise NotesError(f'Expected immutable full commit SHA, got {sha!r}')
if commit(sha) != sha:
raise NotesError(f'Expected commit SHA, not tag object: {sha}')
return sha


def ancestor(old, new):
proc = subprocess.run(['git', 'merge-base', '--is-ancestor', old, new],
text=True, capture_output=True)
if proc.returncode not in (0, 1):
raise NotesError(f'git ancestry check failed: {proc.stderr.strip()}')
return proc.returncode == 0


def same_tree(artifact, source):
if git('rev-parse', artifact + '^{tree}') != git('rev-parse', source + '^{tree}'):
raise NotesError(f'Source tree does not match artifact: {source} vs {artifact}')


class GitHub:
def __init__(self, repo):
self.repo = repo

def api(self, path, optional=False, pages=False):
args = ['gh', 'api', f'repos/{self.repo}/{path}']
if pages:
args += ['--paginate', '--slurp']
proc = subprocess.run(args, text=True, capture_output=True)
if optional and proc.returncode and '(HTTP 404)' in proc.stderr:
return None
if proc.returncode:
raise NotesError(f'GitHub lookup {path} failed: {proc.stderr.strip()}')
try:
return json.loads(proc.stdout)
except ValueError as exc:
raise NotesError(f'Invalid GitHub JSON for {path}') from exc

def body(self, tag):
data = self.api(f'releases/tags/{tag}', optional=True)
if data is None:
return ''
if not isinstance(data, dict) or not isinstance(data.get('body'), (str, type(None))):
raise NotesError(f'Invalid release response for {tag}')
return data.get('body') or ''

def pulls(self, artifact):
pages = self.api(f'commits/{artifact}/pulls?per_page=100', pages=True)
if not isinstance(pages, list) or any(not isinstance(p, list) for p in pages):
raise NotesError('Invalid paginated PR response')
return [pr for page in pages for pr in page]


MARKER = 'release-notes-source-v1'


def metadata(body):
# Generated provenance occupies its own HTML-comment line. A commit title
# or documentation mentioning the marker is ordinary release-note prose.
records = [line.strip() for line in body.splitlines()
if line.lstrip().startswith('<!-- release-notes-source-')]
if not records:
return None
match = re.fullmatch(r'<!-- release-notes-source-v1 (.*?) -->', records[0])
if len(records) != 1 or not match:
raise NotesError('Malformed, duplicate or unsupported release source metadata')
try:
data = json.loads(match[1])
except ValueError as exc:
raise NotesError('Malformed release source metadata JSON') from exc
if not isinstance(data, dict):
raise NotesError('Invalid release source metadata')
return data

def resolve(api, tag, artifact, pinned=None, body=None, allow_direct_merge=False):
"""Metadata is authoritative if present; otherwise bootstrap exact PR evidence."""
data = metadata(api.body(tag) if body is None else body)
if data is not None:
if data.get('tag') != tag or data.get('artifact') != artifact:
raise NotesError(f'Metadata tag/artifact mismatch for {tag}')
source = immutable(data.get('source'))
if data.get('tree') != git('rev-parse', artifact + '^{tree}'):
raise NotesError(f'Metadata tree mismatch for {tag}')
else:
pulls = api.pulls(artifact)
if any(not isinstance(pr, dict) or not isinstance(pr.get('base'), dict)
or not isinstance(pr.get('head'), dict) for pr in pulls):
raise NotesError('Invalid PR record')
matches = [pr for pr in pulls if pr.get('merged_at')
and pr.get('merge_commit_sha') == artifact
and pr.get('base', {}).get('ref') == 'master'
and pr.get('title') == tag]
if len(matches) > 1:
raise NotesError(f'Ambiguous merged release PRs for {tag}')
if matches:
source = immutable(matches[0].get('head', {}).get('sha'))
else:
# A normal, non-merge source commit is self-provenancing. A release
# wrapper needs exact provenance. An explicit manual selection can
# identify a non-wrapper merge as its own complete source history.
subject = git('show', '-s', '--format=%s', artifact)
parents = git('show', '-s', '--format=%P', artifact).split()
if re.match(r'^v?[0-9]+\.[0-9]+\.[0-9]+(?:\s|$)', subject) or (len(parents) > 1 and not allow_direct_merge):
raise NotesError(f'Missing release source provenance for {tag} ({artifact})')
source = artifact
same_tree(artifact, source)
if pinned and immutable(pinned) != source:
raise NotesError(f'Pinned PR source disagrees with provenance for {tag}')
return source


def previous(api, requested, artifact, source):
tags = git('tag', '--list').splitlines()
candidates = [t for t in tags if re.fullmatch(r'v[0-9]+\.[0-9]+\.[0-9]+', t)
and version(t[1:]) < version(requested)]
for tag in sorted(candidates, key=lambda t: version(t[1:]), reverse=True):
old = commit('refs/tags/' + tag)
old_source = resolve(api, tag, old)
related = ancestor(old, artifact) or ancestor(old, source)
if ancestor(old_source, source):
return tag, old, old_source
if related:
raise NotesError(f'Previous source {tag} is not an ancestor of current source')
# Root/rollup is only a first-release boundary, not a provenance fallback.
if candidates:
raise NotesError('No compatible previous release source among older version tags')
if 'pre-v2-rollup' in tags:
old = commit('refs/tags/pre-v2-rollup')
if not ancestor(old, source):
raise NotesError('pre-v2-rollup is not a source ancestor')
return 'pre-v2-rollup', old, old
return None, None, None


def render(subjects, repo, requested, prev):
buckets = {key: [] for key in ('feat', 'fix', 'perf', 'docs', 'other')}
for subject in subjects:
match = re.match(r'^([a-zA-Z]+)(?:\([^)]*\))?!?:\s*(.*)$', subject)
key = match[1] if match and match[1] in buckets and match[1] != 'other' else 'other'
buckets[key].append('- ' + (match[2] if key != 'other' else subject))
parts = []
for key, title in [('feat', '✨ Features'), ('fix', '🐛 Bug fixes'),
('perf', '⚡ Performance'), ('docs', '📚 Documentation')]:
if buckets[key]:
parts.append(f'### {title}\n\n' + '\n'.join(buckets[key]) + '\n')
if buckets['other']:
parts.append('<details>\n<summary>🔧 Maintenance &amp; internal</summary>\n\n'
+ '\n'.join(buckets['other']) + '\n\n</details>')
if prev:
parts.append(f'**Full changelog**: https://github.com/{repo}/compare/{prev}...v{requested}')
return '\n\n'.join(parts)


def generate(requested, target, pinned=None, repo='RayforceDB/rayforce', api=None,
allow_direct_merge=False):
version(requested)
artifact = immutable(target)
api = api or GitHub(repo)
tag = 'v' + requested
tags = git('tag', '--list').splitlines()
if tag in tags and commit('refs/tags/' + tag) != artifact:
raise NotesError(f'Artifact target disagrees with existing tag {tag}')
source = resolve(api, tag, artifact, pinned, body='',
allow_direct_merge=allow_direct_merge)
prev, old, old_source = previous(api, requested, artifact, source)
args = ['log', '--no-merges', '--reverse', '--format=%s', source]
if old:
args += ['--not', old_source, old]
subjects = git(*args).splitlines()
if not subjects or all(re.match(r'^v?[0-9]+\.[0-9]+\.[0-9]+(?:\s|$)', s) for s in subjects):
raise NotesError('Empty or wrapper-only release source delta; explicit release decision required')
data = dict(tag=tag, artifact=artifact, source=source,
tree=git('rev-parse', artifact + '^{tree}'))
return (render(subjects, repo, requested, prev) + '\n\n<!-- ' + MARKER + ' '
+ json.dumps(data, sort_keys=True, separators=(',', ':')) + ' -->\n')


def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('version')
parser.add_argument('artifact_sha')
parser.add_argument('source_sha', nargs='?', default=os.getenv('RELEASE_SOURCE_SHA') or None)
parser.add_argument('--allow-direct-merge', action='store_true',
help='manual dispatch: the selected non-wrapper merge is the source')
args = parser.parse_args()
try:
print(generate(args.version, args.artifact_sha, args.source_sha,
os.getenv('GITHUB_REPOSITORY', 'RayforceDB/rayforce'),
allow_direct_merge=args.allow_direct_merge), end='')
except (NotesError, OSError) as exc:
print(f'release notes: {exc}', file=sys.stderr)
return 1
return 0


if __name__ == '__main__':
sys.exit(main())
Loading
Loading