Skip to content

Commit c18169d

Browse files
authored
Merge pull request #12 from InterestingSoftware/more-webhooks
More hooks
2 parents 782bed9 + f2923a7 commit c18169d

67 files changed

Lines changed: 4744 additions & 2124 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 45 additions & 17 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ permissions:
1818
contents: read
1919

2020
env:
21-
BASE_VERSION: "0.1"
21+
BASE_VERSION: '0.1'
2222

2323
jobs:
2424
docs-lint:
25-
name: "00 · Docs · Drift Lint"
25+
name: '00 · Docs · Drift Lint'
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v6
@@ -35,7 +35,7 @@ jobs:
3535
run: node scripts/check-doc-drift.mjs
3636

3737
check-frontend:
38-
name: "01 · Frontend · Check + Build"
38+
name: '01 · Frontend · Check + Build'
3939
needs: docs-lint
4040
runs-on: ubuntu-latest
4141
steps:
@@ -52,12 +52,12 @@ jobs:
5252

5353
- run: pnpm install --frozen-lockfile
5454
env:
55-
SPROUTGIT_SKIP_PLAYWRIGHT_SETUP: "1"
55+
SPROUTGIT_SKIP_PLAYWRIGHT_SETUP: '1'
5656
- run: pnpm run check
5757
- run: pnpm run build
5858

5959
check-rust:
60-
name: "02 · Rust · Validate (${{ matrix.os }})"
60+
name: '02 · Rust · Validate (${{ matrix.os }})'
6161
needs: docs-lint
6262
runs-on: ${{ matrix.os }}
6363
permissions:
@@ -97,7 +97,7 @@ jobs:
9797
run: cargo clippy -- -D warnings
9898

9999
e2e-generated:
100-
name: "03 · E2E · Generated (${{ matrix.os }})"
100+
name: '03 · E2E · Generated (${{ matrix.os }})'
101101
needs: [check-frontend, check-rust]
102102
runs-on: ${{ matrix.os }}
103103
permissions:
@@ -157,7 +157,7 @@ jobs:
157157
158158
- run: pnpm install --frozen-lockfile
159159
env:
160-
SPROUTGIT_SKIP_PLAYWRIGHT_SETUP: "1"
160+
SPROUTGIT_SKIP_PLAYWRIGHT_SETUP: '1'
161161

162162
- name: Install Playwright browsers (Linux/macOS)
163163
if: runner.os != 'Windows'
@@ -174,13 +174,13 @@ jobs:
174174
if: runner.os == 'Linux'
175175
run: xvfb-run -a pnpm run test:e2e
176176
env:
177-
SPROUTGIT_E2E_SKIP_BUILD: "1"
177+
SPROUTGIT_E2E_SKIP_BUILD: '1'
178178

179179
- name: Run E2E tests (macOS/Windows)
180180
if: runner.os != 'Linux'
181181
run: pnpm run test:e2e
182182
env:
183-
SPROUTGIT_E2E_SKIP_BUILD: "1"
183+
SPROUTGIT_E2E_SKIP_BUILD: '1'
184184

185185
- name: Report E2E test results
186186
if: always()
@@ -203,7 +203,7 @@ jobs:
203203
if-no-files-found: warn
204204

205205
e2e-canary:
206-
name: "04 · E2E · Canary (non-blocking)"
206+
name: '04 · E2E · Canary (non-blocking)'
207207
needs: [check-frontend, check-rust]
208208
runs-on: ubuntu-latest
209209
continue-on-error: true
@@ -244,7 +244,7 @@ jobs:
244244
- name: Run canary E2E tests
245245
run: xvfb-run -a pnpm run test:e2e:canary
246246
env:
247-
SPROUTGIT_E2E_SKIP_BUILD: "1"
247+
SPROUTGIT_E2E_SKIP_BUILD: '1'
248248

249249
- name: Report canary E2E test results
250250
if: always()
@@ -267,7 +267,7 @@ jobs:
267267
if-no-files-found: warn
268268

269269
rust-coverage:
270-
name: "05 · Rust · Coverage (Linux)"
270+
name: '05 · Rust · Coverage (Linux)'
271271
runs-on: ubuntu-latest
272272
permissions:
273273
contents: read
@@ -305,7 +305,7 @@ jobs:
305305
verbose: true
306306

307307
build:
308-
name: "06 · Release · Build Artifacts (${{ matrix.os }})"
308+
name: '06 · Release · Build Artifacts (${{ matrix.os }})'
309309
needs: [check-frontend, check-rust, e2e-generated]
310310
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
311311
environment: CI
@@ -412,7 +412,7 @@ jobs:
412412
src-tauri/target/release/bundle/appimage/*.AppImage.sig
413413
414414
release:
415-
name: "07 · Release · Publish"
415+
name: '07 · Release · Publish'
416416
needs: build
417417
runs-on: ubuntu-latest
418418
permissions:

.github/workflows/deploy-website.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919

2020
jobs:
2121
build:
22-
name: "01 · Build Site"
22+
name: '01 · Build Site'
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
@@ -51,7 +51,7 @@ jobs:
5151
path: website/dist
5252

5353
deploy:
54-
name: "02 · Deploy Pages"
54+
name: '02 · Deploy Pages'
5555
needs: build
5656
runs-on: ubuntu-latest
5757
environment:

CODE_OF_CONDUCT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within

docs/architecture.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub enum SystemAction { CommandLookup, OpenEditor }
1616
```
1717

1818
**Benefits:**
19+
1920
- ✅ Audit trail: every git operation is explicitly named
2021
- ✅ Security: input validation and environment setup centralized
2122
- ✅ Testing: unit tests can validate action uniqueness and invoke patterns
@@ -48,11 +49,13 @@ Result<Output, String>
4849
- Used across git.rs, diff.rs, editor.rs, workspace.rs
4950

5051
2. **Base command builders encapsulate setup**
52+
5153
```rust
5254
pub fn base_git_command() -> Command
5355
pub fn git_command(action: GitAction, args: &[&str]) -> Command
5456
pub fn system_command(action: SystemAction, program: &str, args: &[&str]) -> Command
5557
```
58+
5659
- New operations inherit PATH, environment, and action tracking automatically
5760

5861
3. **Helper utilities are standalone**
@@ -95,11 +98,13 @@ Result<Output, String>
9598
### Current Composability: 4/10
9699

97100
**Can compose:**
101+
98102
- Input validators (stack them: `validate_non_option_value()` → `validate_repo_url()`)
99103
- Command builders (call `git_command()` with different args)
100104
- Error handling (try-catch chains)
101105

102106
**Cannot easily compose:**
107+
103108
- Multi-step atomic operations (transaction/rollback pattern needed)
104109
- Result aggregation (no collector/builder for complex results)
105110
- Batch operations (no queue or pipeline abstraction)
@@ -209,6 +214,7 @@ pub async fn tag_list(repo_path: String) -> Result<Vec<TagInfo>, String> {
209214
### Tier 1: High-Value, Low-Effort
210215

211216
**1. Add a `GitTransaction` builder pattern**
217+
212218
```rust
213219
pub struct GitTransaction {
214220
ops: Vec<Box<dyn GitOp>>,
@@ -222,62 +228,70 @@ impl GitTransaction {
222228
pub fn execute(self) -> Result<Vec<Output>, String> { ... }
223229
}
224230
```
231+
225232
- **Benefit**: Multi-step operations with rollback; atomic from user perspective
226233
- **Effort**: ~200 lines
227234
- **Example**: `GitTransaction::new().create_worktree(...).checkout(...).execute()?`
228235

229236
**2. Add read-only caching with invalidation**
237+
230238
```rust
231239
pub struct GitCache {
232240
refs: RefCell<Option<CachedValue<Vec<RefInfo>>>>,
233241
status: RefCell<Option<CachedValue<StatusOutput>>>,
234242
}
235243
```
244+
236245
- **Benefit**: 30-40% reduction for read-heavy workflows
237246
- **Effort**: ~150 lines
238247
- **Example**: Second `list_refs()` call returns cached result
239248

240249
### Tier 2: Medium-Value, Medium-Effort
241250

242251
**3. Add async/parallel operation support**
252+
243253
- Use `tokio` or `async-std` for parallel unrelated git operations
244254
- **Benefit**: Faster batch operations, non-blocking frontend
245255
- **Effort**: ~300 lines + dependency
246256

247257
**4. Add semantic high-level operations**
258+
248259
```rust
249260
pub async fn create_feature_branch_with_worktree(
250261
repo_path: &str,
251262
branch_name: &str,
252263
from_ref: &str,
253264
) -> Result<CreateFeatureBranchResult, String>
254265
```
266+
255267
- Combines create + checkout + validation
256268
- **Benefit**: Simpler client code, fewer edge cases
257269
- **Effort**: ~100 lines per operation
258270

259271
### Tier 3: Lower-Priority
260272

261273
**5. Add middleware/instrumentation layer**
274+
262275
- Logging, metrics, tracing for each git operation
263276
- **Benefit**: Observability, debugging, performance profiling
264277

265278
**6. Add plugin system**
279+
266280
- Dynamic operation registration
267281
- **Benefit**: Third-party extensions
268282
- **Effort**: ~500+ lines
269283

270284
## Verdict: Is It a Good Platform?
271285

272-
| Aspect | Rating | Notes |
273-
|--------|--------|-------|
274-
| **Security** | 9/10 | Excellent input validation, injection-safe |
275-
| **Auditability** | 9/10 | All operations registered, testable |
276-
| **Reusability** | 7/10 | Validators and helpers are reusable; high-level ops are not |
277-
| **Composability** | 4/10 | Can't easily chain multi-step operations without manual orchestration |
278-
| **Performance** | 7/10 | Efficient for single operations; could batch better |
279-
| **Extensibility** | 6/10 | Easy to add new git operations; hard to extend behavior |
280-
| **Async-Ready** | 6/10 | Uses async/await at Tauri boundary, but operations are blocking |
286+
| Aspect | Rating | Notes |
287+
| ----------------- | ------ | --------------------------------------------------------------------- |
288+
| **Security** | 9/10 | Excellent input validation, injection-safe |
289+
| **Auditability** | 9/10 | All operations registered, testable |
290+
| **Reusability** | 7/10 | Validators and helpers are reusable; high-level ops are not |
291+
| **Composability** | 4/10 | Can't easily chain multi-step operations without manual orchestration |
292+
| **Performance** | 7/10 | Efficient for single operations; could batch better |
293+
| **Extensibility** | 6/10 | Easy to add new git operations; hard to extend behavior |
294+
| **Async-Ready** | 6/10 | Uses async/await at Tauri boundary, but operations are blocking |
281295

282296
**Recommendation**:**Yes, it's a solid foundation**, but add a `GitTransaction` pattern (Tier 1) before building complex workflows. This adds composability and rollback semantics without breaking existing code.
283297

docs/benchmark-repository-strategy.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SproutGit Benchmark Repository Strategy
22

33
## Purpose
4+
45
Define a durable strategy for sample repositories used by SproutGit for:
56

67
- Product screenshots and videos
@@ -11,6 +12,7 @@ Define a durable strategy for sample repositories used by SproutGit for:
1112
This strategy avoids stale, hand-curated datasets while preserving deterministic media capture.
1213

1314
## Decision Summary
15+
1416
Use a hybrid model:
1517

1618
1. Generated benchmark repositories are the source of truth.
@@ -24,6 +26,7 @@ Rationale:
2426
- Generated plus snapshot repositories provide both freshness and repeatability.
2527

2628
## Repository Classes
29+
2730
### Class A: Hero Media Repository
2831

2932
Use one stable benchmark repo for all public screenshots and videos.
@@ -66,6 +69,7 @@ Policy:
6669
- Failures trigger investigation, not immediate release failure.
6770

6871
## Freshness and Stability Model
72+
6973
### Continuous Freshness
7074

7175
Maintain generator scripts and regenerate benchmark repositories regularly.
@@ -90,6 +94,7 @@ Usage:
9094
- CI runs should include latest plus previous snapshot for drift checks.
9195

9296
## Media Capture Policy
97+
9398
Use a deterministic runbook for screenshots and videos.
9499

95100
Rules:
@@ -109,6 +114,7 @@ Suggested canonical shot list:
109114
6. Context menu and copy actions
110115

111116
## Governance and Ownership
117+
112118
### Owners
113119

114120
- Maintainers own benchmark scenario definitions and acceptance criteria.
@@ -125,6 +131,7 @@ Any benchmark scenario change should include:
125131
4. Whether a new snapshot tag is required
126132

127133
## CI and Validation Strategy
134+
128135
Planned checks:
129136

130137
1. Generator outputs are deterministic for fixed seeds
@@ -138,6 +145,7 @@ Recommended lane split:
138145
- Non-blocking lane: popular repository canaries
139146

140147
## Risk Register
148+
141149
Risk: benchmark scenarios become unrealistic.
142150
Mitigation: periodic review against real-world canary findings.
143151

@@ -151,12 +159,14 @@ Risk: media inconsistency across releases.
151159
Mitigation: enforce pinned snapshot plus canonical capture runbook.
152160

153161
## Success Criteria
162+
154163
1. Screenshot and video capture remains reproducible across releases.
155164
2. Benchmark datasets are refreshed via defined regeneration triggers without manual churn.
156165
3. Regressions are detected in generated benchmarks before release.
157166
4. Canary lane reveals real-world drift without destabilizing release cadence.
158167

159168
## Rollout Plan
169+
160170
### Phase 1
161171

162172
- Define scenario modules and deterministic generation inputs
@@ -182,6 +192,7 @@ Mitigation: enforce pinned snapshot plus canonical capture runbook.
182192
- Publish internal guidance for maintainers and contributors
183193

184194
## Open Questions
195+
185196
1. Which exact repos should be in the canary rotation?
186197
2. What retention window is appropriate for snapshot tags?
187198
3. Which benchmark failures should block release immediately?

docs/branch-worktree-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@ Remote refs are source of truth for synchronization status, but local lifecycle
153153
- Predictable for day-to-day local development.
154154
- Scales for multi-agent and multi-worktree usage.
155155
- Compatible with varied remote team workflows.
156-
- Safe by default while still allowing advanced flexibility.
156+
- Safe by default while still allowing advanced flexibility.

0 commit comments

Comments
 (0)