Skip to content

feat(brainbar): stamp builds with git commit + UTC time in Info.plist#264

Merged
EtanHey merged 2 commits intomainfrom
feat/brainbar-build-stamp
May 1, 2026
Merged

feat(brainbar): stamp builds with git commit + UTC time in Info.plist#264
EtanHey merged 2 commits intomainfrom
feat/brainbar-build-stamp

Conversation

@EtanHey
Copy link
Copy Markdown
Owner

@EtanHey EtanHey commented May 1, 2026

Summary

  • stamp BrainBar builds with GitCommit, GitDescribe, and BuildTimeUTC in Info.plist
  • write the stamp during brain-bar/build-app.sh before signing so deployed bundles carry provenance
  • keep the PR atomic to the build script only

Why

  • Phase B needs direct provenance on the installed bundle so old-version resurrection is diagnosable in seconds instead of by filesystem archaeology
  • this is the first guardrail before rejecting non-canonical installs in the next step

Verification

  • bash -n brain-bar/build-app.sh
  • uv sync --extra dev --extra cloud
  • uv run --extra dev pytest -v --tb=short tests/test_git_learning.py::test_brain_learn_git_seeds_single_repo_without_duplicates tests/test_phase3_digest.py::test_digest_content_returns_structured_result tests/test_phase3_digest.py::test_digest_content_creates_chunk tests/test_phase3_digest.py::test_digest_content_extracts_entities tests/test_phase3_digest.py::test_digest_content_applies_sentiment tests/test_phase3_digest.py::test_digest_content_confidence_tiers tests/test_phase3_digest.py::test_digest_extracts_action_items tests/test_phase3_digest.py::test_full_digest_pipeline tests/test_smart_search_entity_dedup.py::TestDigestEntityDedup::test_digest_deduplicates_repeated_entity_mentions tests/test_smart_search_entity_dedup.py::TestDigestEntityDedup::test_digest_deduplicates_case_variants
  • bash scripts/run_tests.sh

Context

  • Collab: orchestrator/collab/2026-05-01-brainlayer-split-brain-architecture-decision.md

Note

Low Risk
Low risk: build-script-only change that adds metadata to the generated .app bundle; main risk is build failures on environments lacking git metadata or PlistBuddy behavior differences.

Overview
Adds build provenance stamping to brain-bar/build-app.sh by writing GitCommit, GitDescribe, and BuildTimeUTC into the generated app bundle’s Info.plist (via PlistBuddy) before codesigning, and logs the stamped values during the build.

Reviewed by Cursor Bugbot for commit 2e4ae97. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Stamp brain-bar app bundle Info.plist with git commit and UTC build time

Updates build-app.sh to write GitCommit, GitDescribe, and BuildTimeUTC keys into Info.plist after copying it into the app bundle. Three helper functions capture the git SHA, descriptive ref, and RFC3339 UTC timestamp, and a plist_set_string helper uses PlistBuddy to add or update each key. The stamped values are printed to stdout during the build.

Macroscope summarized 2e4ae97.

Summary by CodeRabbit

  • Chores
    • Build process now embeds Git metadata (commit reference and descriptive tag) and a UTC build timestamp into the app bundle and logs these values during the build, improving traceability and build diagnostics prior to code signing.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@EtanHey
Copy link
Copy Markdown
Owner Author

EtanHey commented May 1, 2026

@codex review

@EtanHey
Copy link
Copy Markdown
Owner Author

EtanHey commented May 1, 2026

@cursor @BugBot review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

The build script brain-bar/build-app.sh now computes Git metadata (commit SHA, git describe, ISO-8601 UTC timestamp) at build time and writes these values into the app bundle's Contents/Info.plist using /usr/libexec/PlistBuddy, then logs the stamped fields before codesigning.

Changes

Cohort / File(s) Summary
Build Script Git Metadata Stamping
brain-bar/build-app.sh
Adds extraction of Git commit SHA (git rev-parse HEAD), git describe --always --dirty, and UTC timestamp; adds/updates GitCommit, GitDescribe, and BuildTimeUTC keys in Contents/Info.plist via PlistBuddy; logs the values before existing codesign step.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped into the build at break of day,
Stamped commit and time in a tidy way,
PlistBuddy wrote them down with care,
Now each bundle knows when it woke from air—
Hooray for builds with history to share! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding build-time Git metadata (commit SHA and timestamp) to the app's Info.plist file, which matches the core purpose of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/brainbar-build-stamp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 1, 2026

Excellent! Everything is in perfect order. Let me now create a concise summary for the user:

Bugbot Review Complete ✅

I've completed a comprehensive review of PR #264 (feat/brainbar-build-stamp) and taken proactive action to improve the code.

What I Found

✅ Overall: APPROVED - The build provenance stamping implementation is well-designed and correctly integrated.

Key findings:

  • Core logic is sound: git provenance functions, timestamp formatting, and plist operations are all correct
  • Integration timing is optimal: stamping occurs after bundle creation but before codesigning (exactly where it should be)
  • Security: No injection risks, proper variable scoping
  • Performance: Minimal overhead (~100ms)
  • Edge cases well-handled: detached HEAD, no tags, dirty working directory, shallow clones

Issue Identified & Fixed

Minor quoting issue in plist_set_string() function (lines 41, 43):

  • $value variable was unquoted in PlistBuddy command strings
  • Low real-world risk (git SHAs/timestamps don't contain spaces), but theoretically vulnerable
  • Fixed in commit 2e4ae97: Added double quotes around $value for defensive programming

Test Results

  • 10/10 specified tests PASSED (7.03s)
  • 32/32 extended pytest suite PASSED (4.94s)
  • ✅ Bash syntax validation PASSED
  • ✅ All tests still pass after applying the fix

Changes Pushed

2e4ae97 fix(brainbar): quote PlistBuddy values to handle edge cases
88c9b0c feat(brainbar): stamp builds with git commit + UTC time in Info.plist

Risk Level: 🟢 LOW (build script only, no runtime changes, easy rollback)

Final Verdict: PR is production-ready and approved for merge. The fix I applied makes it more robust against edge cases.

Open in Web Open in Cursor 

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 88c9b0c. Configure here.

Comment thread brain-bar/build-app.sh Outdated
- Add double quotes around $value in plist_set_string function
- Prevents potential issues if git describe output contains spaces
- Low risk fix identified during bugbot review
- All 10 verification tests still passing

Co-authored-by: Etan Heyman <EtanHey@users.noreply.github.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@EtanHey EtanHey merged commit 37a0411 into main May 1, 2026
7 checks passed
EtanHey pushed a commit that referenced this pull request May 2, 2026
- Recent Hardening section traces each claim to a merged PR
- BrainBar build-script guards (#264, #265) called out at the install step
- Phase B preventive infra block (orchestrator#58, #60) connects deploy registry
  to the BrainBar build-stamp + canonical-build refuse layer
- In-flight PR #251 entry documents NSPanel revival + trigram FTS5 startup-safety
  guard (10K-chunk threshold) + preserved /tmp/brainbar.sock pub/sub plane

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EtanHey pushed a commit that referenced this pull request May 3, 2026
- Recent Hardening section traces each claim to a merged PR
- BrainBar build-script guards (#264, #265) called out at the install step
- Phase B preventive infra block (orchestrator#58, #60) connects deploy registry
  to the BrainBar build-stamp + canonical-build refuse layer
- In-flight PR #251 entry documents NSPanel revival + trigram FTS5 startup-safety
  guard (10K-chunk threshold) + preserved /tmp/brainbar.sock pub/sub plane

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EtanHey added a commit that referenced this pull request May 3, 2026
…267)

- Recent Hardening section traces each claim to a merged PR
- BrainBar build-script guards (#264, #265) called out at the install step
- Phase B preventive infra block (orchestrator#58, #60) connects deploy registry
  to the BrainBar build-stamp + canonical-build refuse layer
- In-flight PR #251 entry documents NSPanel revival + trigram FTS5 startup-safety
  guard (10K-chunk threshold) + preserved /tmp/brainbar.sock pub/sub plane

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants