Skip to content

feat: project type detection and git safety rules#123

Merged
bradygaster merged 2 commits intodevfrom
squad/87-project-type-detection
Feb 20, 2026
Merged

feat: project type detection and git safety rules#123
bradygaster merged 2 commits intodevfrom
squad/87-project-type-detection

Conversation

@bradygaster
Copy link
Copy Markdown
Owner

Closes #86
Closes #87

Changes

  • Project type detection: Implement detectProjectType() and generateProjectWorkflowStub() to support non-npm projects
  • Git safety rules: Add safety rules to spawn templates to prevent undoing uncommitted user changes
  • Testing: Comprehensive regression test suite in test/git-safety.test.js for both features

All 64+ tests pass. Branch is ready for review.

bradygaster and others added 2 commits February 20, 2026 01:26
…jects (#87)

- Add detectProjectType() to index.js — checks package.json (npm), go.mod (go),
  requirements.txt/pyproject.toml (python), pom.xml/build.gradle (java),
  *.csproj/*.sln (dotnet), fallback to 'unknown'
- Add PROJECT_TYPE_SENSITIVE_WORKFLOWS set — 5 workflows with npm assumptions
- Add generateProjectWorkflowStub() — valid YAML stub per workflow + project type,
  with TODO comment and example commands for all supported types
- Add writeWorkflowFile() helper — verbatim copy for npm, stub for others
- Update all 3 workflow copy paths (init, upgrade, upgrade-already-current)
- Update test/workflows.test.js: add package.json to temp dirs in byte-for-byte
  match tests so they correctly assert 'npm project gets verbatim copy'
- All 72 tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Session: 2026-02-20-issue-86-87
Agents: Verbal (Git Safety), Hockney (Testing), Fenster (Project Type Detection)

Changes:
- Created orchestration logs for Verbal, Hockney, Fenster
- Created session log documenting issues #86 and #87
- Merged fenster-project-type-detection.md from decisions inbox to decisions.md
- Updated Fenster and Verbal agent histories with cross-team updates
- All 72 tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster merged commit 2f8637a into dev Feb 20, 2026
1 check passed
bradygaster added a commit that referenced this pull request Feb 20, 2026
## Orchestration Log

Created per-agent orchestration entries for diagnostic session:
- fenster.md: v0.5.0 upgrade testing findings
- hockney.md: test coverage gap analysis
- verbal.md: migration flow logic analysis
- kobayashi.md: git-side risk audit

## Session Log

Created session summary documenting:
- Investigation scope and participants
- Three confirmed bugs and their impacts
- 13 test coverage gaps identified
- Recommended actions for each issue

## Decision Log

Merged inbox decisions into unified .ai-team/decisions.md covering:
- Issue #125: migration early exit (blocking normal upgrade)
- Issue #124: .slnx detection missing
- Issue #126: git history loss warning needed
- Migration directory detection bug in 0.5.0 migration
- Test coverage recommendations
- Fix options and recommendations
- PR #123 status tracking
- Release rollback to v0.4.2 rationale

## Cleaned Up

Deleted .ai-team/decisions/inbox/* files after merging to decisions.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster added a commit that referenced this pull request Feb 20, 2026
…, decision merge

Session: 2026-02-20-docs-release-publish
Requested by: Team (automated)

Changes:
- Added orchestration logs for McManus (What's New sections, whatsnew.md creation, README trim)
- Added orchestration logs for Kobayashi (release audit, selective docs push to main)
- Created session log documenting release publication workflow
- Merged inbox decisions: documentation content architecture (consolidated), PR #123 project type detection and git safety
- Deleted merged inbox files (0 remaining inbox decisions)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster deleted the squad/87-project-type-detection branch February 27, 2026 01:19
diberry added a commit that referenced this pull request Mar 31, 2026
The budget calculation in archiveDecisions() did not account for the
newline separators added during content reassembly (header + '\n' +
entries.join('\n') + '\n'). This caused the final recentContent to
exceed DECISION_THRESHOLD even after archival, so the size limitation
kept being reapplied on subsequent nap runs.

Fix: add reassemblyOverhead (2 bytes for header/trailing newlines)
and +1 byte per entry for join separators to the budget calculation.

Closes #123

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Mar 31, 2026
The budget calculation in archiveDecisions() did not account for the
newline separators added during content reassembly (header + '\n' +
entries.join('\n') + '\n'). This caused the final recentContent to
exceed DECISION_THRESHOLD even after archival, so the size limitation
kept being reapplied on subsequent nap runs.

Fix: add reassemblyOverhead (2 bytes for header/trailing newlines)
and +1 byte per entry for join separators to the budget calculation.

Closes #123

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 1, 2026
The budget calculation in archiveDecisions() did not account for the
newline separators added during content reassembly (header + '\n' +
entries.join('\n') + '\n'). This caused the final recentContent to
exceed DECISION_THRESHOLD even after archival, so the size limitation
kept being reapplied on subsequent nap runs.

Fix: add reassemblyOverhead (2 bytes for header/trailing newlines)
and +1 byte per entry for join separators to the budget calculation.

Closes #123

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 2, 2026
Fixes off-by-N error in nap command's decision archival where newline
separators between entries weren't counted in the byte budget, causing
archives to exceed the target size.

Closes #123

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 2, 2026
Closes #123

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher added a commit that referenced this pull request Apr 2, 2026
* feat(ci): add concurrency controls to 5 workflows (Phase 3 item A1)

Add concurrency blocks with cancel-in-progress to squad-ci, squad-heartbeat,
squad-triage, squad-label-enforce, and squad-issue-assign workflows.

Scope: .github/workflows/ only (squad repo CI).
Template workflows for customer repos are a separate product concern.

Test: 20 assertions covering all 5 workflows.

Refs: diberry#122

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: proposal for contributor guide improvements

Audited all contributor-facing files on dev branch and identified 8 gaps
in external contributor experience. Proposes 7 deliverables prioritized
by maintainer time savings:

P1: Issue templates, good-first-issue curation, .squad/ explainer
P2: CODE_OF_CONDUCT.md, contributor FAQ, README contributing section
P3: SECURITY.md typo fix

Goal: contributors self-serve from docs instead of asking Brady/Tamir
the same questions repeatedly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(nap): account for separator newlines in decision archival budget

Fixes off-by-N error in nap command's decision archival where newline
separators between entries weren't counted in the byte budget, causing
archives to exceed the target size.

Closes #123

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(watch): port ralph-watch.ps1 resilience features (#743)

Port battle-tested features from ralph-watch.ps1 into squad-cli watch.
All features are org-agnostic, config-driven, and backward compatible.

P0 Reliability:
- ModelCircuitBreaker: model-level fallback with cooldown + state persistence
- Rate limit detection from API headers, predictive circuit opening
- Pre-round health check (auth, disk space, branch drift, CB validation)
- Post-failure remediation with tiered self-healing (reset CB, re-auth, git pull)

P1 Execution Quality:
- Issue priority scoring (P0-P3 labels, age, staleness, size, bug bonus)
- Machine capability checking (needs:* labels vs local probes)
- Stale work reclaim (unassign issues idle >24h)
- Budget check (max issues per round)

P2 Observability:
- Heartbeat file (.squad/ralph-heartbeat.json) written every round
- Structured log (.squad/ralph-watch.log) with rotation
- Per-repo lockfile with PID, stale detection
- Webhook alerts on consecutive failures (--webhook-url, --alert-threshold)

CLI flags: --webhook-url, --alert-threshold, --max-budget, --capabilities

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(watch): add cooperative rate pool for multi-instance coordination (#743)

Ported from ralph-watch.ps1 New-RatePool / Read-RatePool / Write-RatePool /
Update-RatePool budget coordination logic.

- New rate-pool.ts: tracks API call budget per interval window with
  file-based advisory locking (atomic temp+rename writes, retry on
  contention). Multiple Ralph instances share .squad/ralph-rate-pool.json.
- execute.ts: acquireSlot() gates each issue before agent spawn;
  releaseSlot() fires in finally block. Budget-exhausted issues are
  skipped with a log line, not failed.
- config.ts: watch.ratePool.maxCallsPerInterval (default 50) and
  watch.ratePool.intervalSeconds (default 600) wired through the
  three-tier merge (defaults < file < CLI).
- index.ts: re-exports RatePool and types from the capability barrel.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: add CHANGELOG entry for watch resilience parity (#743)

* fix(ci): regenerate lockfile for workspace integrity (#743)

The stale package-lock.json resolved @bradygaster/squad-sdk from the
npm registry instead of the workspace link, causing workspace-integrity
and test (rollup native binary) CI failures.

Delete and regenerate the lockfile so npm resolves squad-sdk via the
workspace symlink.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(ci): regenerate lockfile with cross-platform deps and workspace links

- Regenerated package-lock.json from clean state to fix two CI failures:
  1. workspace-integrity: stale registry entry for @bradygaster/squad-sdk
     resolved to npmjs.org instead of local workspace link
  2. test: lockfile missing @rollup/rollup-linux-x64-gnu (only had win32
     platform entries)

- Fresh npm install produces lockfile with all platform optional deps
  and correct workspace symlinks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(cli): ensure all watch flags are parsed and passed through (#739)

The watch/triage command in cli-entry.ts previously only parsed --interval,
silently ignoring all other flags (--monitor-teams, --execute, --board, etc.).

Our #743 watch-parity work already added parsing for all registered capability
flags and new resilience flags. This commit completes the fix by adding unknown
flag detection: any --flag not in the known set now prints a warning instead of
being silently dropped.

Closes #739
Refs #743

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Dina Berry (She/her) <diberry@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Brady Gaster <41929050+bradygaster@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.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.

1 participant