mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-27 22:15:33 +00:00
* feat(exports): expose runThink synthesis via gbrain/think subpath The think synthesis pipeline (runThink, stripGapsSection, persistSynthesis, maxOutputTokensFor + the ThinkResult/ParsedCitation types) lives in src/core/think/index.ts but is not reachable through the public exports map. Downstream consumers importing `gbrain/think` fail to resolve it, and no other exported entrypoint re-exports runThink. Add `./think` to package.json exports and extend the public-exports contract test (count 20 -> 21; new EXPECTED_EXPORTS row with runtime canaries runThink + stripGapsSection). Test passes 38/38. Left the VERSION / package.json version / CHANGELOG / llms bumps to the maintainer /ship flow to avoid colliding with the version-queue allocator. * fix(ci): bump public-exports guard baseline to 21 for gbrain/think The new ./think subpath grows the exports map to 21 entries; scripts/check-exports-count.sh still pinned EXPECTED_COUNT=20 and exits 1 on growth, failing CI. Co-authored-by: mnemonik-dev <dev@mnemonik.xyz> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Garry Tan <garrytan@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
49 lines
2.0 KiB
Bash
Executable File
49 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# CI guard: the public exports surface never shrinks silently (v0.21.0).
|
|
#
|
|
# Precedent: scripts/check-jsonb-pattern.sh + check-progress-to-stdout.sh
|
|
# are grep-based structural guards wired into `bun run test`. This one
|
|
# counts the entries in package.json "exports" and fails when the count
|
|
# drops below the v0.21.0 baseline (17 entries).
|
|
#
|
|
# Policy (from CLAUDE.md):
|
|
# "Removing any of these is a breaking change going forward."
|
|
#
|
|
# If you're legitimately removing a public export: bump gbrain's minor
|
|
# version, note the removal in CHANGELOG.md under a "Breaking changes"
|
|
# bullet, then bump EXPECTED_COUNT below. Anything else is a regression.
|
|
#
|
|
# Adding a new export: update EXPECTED_COUNT to match AND extend the
|
|
# EXPECTED_EXPORTS list in test/public-exports.test.ts so the runtime
|
|
# contract test pins the canary symbol.
|
|
|
|
set -euo pipefail
|
|
|
|
EXPECTED_COUNT=21
|
|
|
|
# Count top-level keys in the exports object. `node -e` parses JSON
|
|
# reliably without needing jq (which isn't in every CI environment).
|
|
ACTUAL=$(node -e "
|
|
const pkg = require('./package.json');
|
|
console.log(Object.keys(pkg.exports || {}).length);
|
|
")
|
|
|
|
if [ "$ACTUAL" -lt "$EXPECTED_COUNT" ]; then
|
|
echo "❌ public-exports guard: package.json exports shrank from $EXPECTED_COUNT to $ACTUAL"
|
|
echo " Removing a public export is a breaking change (see CLAUDE.md)."
|
|
echo " If intentional: bump gbrain minor version + update EXPECTED_COUNT in"
|
|
echo " scripts/check-exports-count.sh and EXPECTED_EXPORTS in"
|
|
echo " test/public-exports.test.ts, AND add a CHANGELOG 'Breaking changes' bullet."
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$ACTUAL" -gt "$EXPECTED_COUNT" ]; then
|
|
echo "⚠️ public-exports guard: package.json exports grew from $EXPECTED_COUNT to $ACTUAL"
|
|
echo " Additive public API change. Update EXPECTED_COUNT in this script + the"
|
|
echo " EXPECTED_EXPORTS list in test/public-exports.test.ts to lock the new"
|
|
echo " canary symbols."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✓ public-exports guard: $ACTUAL entries (matches baseline $EXPECTED_COUNT)"
|