Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
d6e8ea0
fix(orchestrator): respect KG action template CLI tool in routing eng…
AlexMikhalev Apr 17, 2026
52d4b34
[agent] feat(spawner): add SpawnContext for per-call working_dir - Re…
AlexMikhalev Apr 18, 2026
e6baa83
[agent] feat(spawner): thread SpawnContext through spawn API and migr…
AlexMikhalev Apr 18, 2026
0540f00
[agent] test(spawner): add SpawnContext unit tests - Refs terraphim/a…
AlexMikhalev Apr 18, 2026
5974354
[agent] style(spawner): cargo fmt - Refs terraphim/adf-fleet#3
AlexMikhalev Apr 18, 2026
8316da6
[agent] feat(orchestrator): make FlowDefinition.project required (D14)
AlexMikhalev Apr 19, 2026
51705f4
[agent] feat(orchestrator): add Project struct + multi-project config…
AlexMikhalev Apr 19, 2026
565739b
fix(orchestrator): add project field to existing flow TOML fixtures
AlexMikhalev Apr 19, 2026
afb514d
test(orchestrator): add multi-project config + include-glob validatio…
AlexMikhalev Apr 19, 2026
6726e40
feat(orchestrator): add adf --check dry-run with routing table output
AlexMikhalev Apr 19, 2026
4ad380a
style(orchestrator): apply cargo fmt
AlexMikhalev Apr 19, 2026
a9b48b4
Merge pull request 'Fix #3: terraphim_spawner SpawnContext for per-ca…
AlexMikhalev Apr 19, 2026
916e9cd
Merge pull request 'Fix #2: Multi-project config schema + include loa…
AlexMikhalev Apr 19, 2026
5e88736
fix(orchestrator): validate config at runtime startup - Refs terraphi…
AlexMikhalev Apr 19, 2026
c25c265
feat(haystack): wire jmap feature for terraphim_agent + Personal Assi…
Apr 17, 2026
953a643
docs(sysop): refresh setup script + README — durable path, no emoji
Apr 17, 2026
b28995e
feat(mcp): jmap feature + how-to for Claude Code/opencode integration
Apr 18, 2026
173554a
fix(terraphim_agent): utf-8 safe snippet truncation
Apr 18, 2026
fa0456e
feat(service): add auto_route module skeleton with types Refs #613
Apr 19, 2026
d933677
feat(service): rank-weighted role scoring with PA/JMAP downweight Ref…
Apr 19, 2026
d8690b6
feat(agent): wrap auto_select_role behind resolve_or_auto_route Refs …
Apr 19, 2026
ed44290
feat(agent): auto-route on search when --role is unset Refs #613
Apr 19, 2026
1abb484
feat(mcp): auto-route on search tool when role argument is unset Refs…
Apr 19, 2026
bca6d38
test(middleware): jmap regression for PA terraphim query Refs #613
Apr 19, 2026
ac56f81
docs: explain auto-routing default and override Refs #613
Apr 19, 2026
ba89d39
chore: rebuild with --features jmap for release verification Refs #613
Apr 19, 2026
a1e0d81
fix(agent): warm per-role thesauri before auto-route scoring
Apr 19, 2026
0e4aabf
[agent] feat(tracker): expose owner() and repo() accessors - Refs ter…
claude Apr 19, 2026
1036fae
[agent] feat(orchestrator): thread project_id through dispatch, spawn…
claude Apr 19, 2026
4ef50ee
[agent] test(orchestrator): project dispatch, concurrency, cooldown, …
claude Apr 19, 2026
33d58c5
test(orchestrator): cover banned fallback_model at startup - Refs ter…
AlexMikhalev Apr 19, 2026
12767c4
test(orchestrator): tighten positive assertions with config accessor …
AlexMikhalev Apr 19, 2026
776f767
Merge pull request 'Fix #11: validate config at runtime startup' (#61…
AlexMikhalev Apr 19, 2026
42b375b
Merge pull request 'Fix #4: thread project_id through dispatch, spawn…
AlexMikhalev Apr 19, 2026
46016f8
fix(auto-route): score against thesaurus to fix cold-start zero scori…
Apr 19, 2026
4707a53
test(auto-route): adapt T1-T7 to distinct-concept scoring Refs #617
Apr 19, 2026
84d0026
test(auto-route): add cold-start regression guard (T11) Refs #617
Apr 19, 2026
1bf6a41
refactor(agent): drop redundant auto-route pre-warm hotfix Refs #617
Apr 19, 2026
c848f7d
docs(howto): update auto-route example scores to distinct-concept mag…
Apr 19, 2026
7b41c31
[agent] feat(orchestrator): allowed-provider runtime filter for C1/C3…
AlexMikhalev Apr 19, 2026
a4012ca
[agent] feat(orchestrator): extend mention regex and project-aware re…
AlexMikhalev Apr 19, 2026
487282d
[agent] feat(orchestrator): gate spawn_agent on CostTracker::should_p…
AlexMikhalev Apr 19, 2026
4993813
[agent] feat(orchestrator): per-project MentionCursor keys
AlexMikhalev Apr 19, 2026
22181ab
[agent] feat(orchestrator): one-shot legacy mention-cursor migration
AlexMikhalev Apr 19, 2026
88f2bd5
[agent] feat(orchestrator): ProviderBudgetTracker with hour+day windo…
AlexMikhalev Apr 19, 2026
9ebdd08
[agent] feat(orchestrator): fan out mention polling across per-projec…
AlexMikhalev Apr 19, 2026
553d3b4
[agent] test(orchestrator): multi-repo mention regex, resolver, curso…
AlexMikhalev Apr 19, 2026
adda369
[agent] feat(orchestrator): wire ProviderBudgetTracker into dispatch …
AlexMikhalev Apr 19, 2026
f63c239
[agent] test(orchestrator): provider gate integration tests - Refs te…
AlexMikhalev Apr 19, 2026
2241fc9
[agent] fix(orchestrator): tighten is_allowed_provider bare-name allo…
AlexMikhalev Apr 20, 2026
ac88e5f
[agent] fix(orchestrator): wire ProviderBudgetTracker.record_cost in …
AlexMikhalev Apr 20, 2026
07cd2aa
[agent] fix(orchestrator): persist ProviderBudgetTracker per tick - R…
AlexMikhalev Apr 20, 2026
d849067
[agent] fix(orchestrator): merge hour/day window locks - Refs terraph…
AlexMikhalev Apr 20, 2026
e306872
[agent] test(orchestrator): update routing tests to allow-list-confor…
AlexMikhalev Apr 20, 2026
fc28fbb
[agent] fix(orchestrator): wire project-aware resolve_mention into di…
AlexMikhalev Apr 20, 2026
7c74398
[agent] style(orchestrator): apply cargo fmt - Refs terraphim/adf-fle…
AlexMikhalev Apr 20, 2026
c9eb6b6
Merge pull request 'Fix terraphim/adf-fleet#5: mention router multi-r…
AlexMikhalev Apr 20, 2026
ab5f1ca
Merge pull request 'Fix #6: subscription-aware provider gate + wire d…
AlexMikhalev Apr 20, 2026
73bfac9
fix(tests): cross-platform false binary, MCP auto-route content shape…
Apr 20, 2026
e4335d7
style(clippy): fix tied.contains and drop redundant deref on config_s…
Apr 20, 2026
e862d54
[agent] feat(adf-setup): migration script skeleton with IO, dry-run, …
AlexMikhalev Apr 20, 2026
0007062
[agent] feat(adf-setup): TOML transformation + project/agent/flow inj…
AlexMikhalev Apr 20, 2026
3d5b6b3
[agent] feat(adf-setup): banned-provider loud-fail validation - Refs …
AlexMikhalev Apr 20, 2026
382c1b6
[agent] test(adf-setup): fixture-based round-trip + idempotence + C1 …
AlexMikhalev Apr 20, 2026
af9d37f
[agent] feat(adf-setup): committed sample conf.d/ output from fixture…
AlexMikhalev Apr 20, 2026
073ee71
[agent] feat(orchestrator): add per-provider error-signature classifi…
AlexMikhalev Apr 20, 2026
9e0a10a
[agent] fix(adf-setup): sync banned-provider list with Rust validator…
AlexMikhalev Apr 20, 2026
122281f
[agent] fix(adf-setup): preserve [workflow].enabled through TOML tran…
AlexMikhalev Apr 20, 2026
ec99e56
[agent] test(adf-setup): subprocess adf --check on generated output +…
AlexMikhalev Apr 20, 2026
23c0749
[agent] feat(orchestrator): wire error-signature classifier into spaw…
AlexMikhalev Apr 20, 2026
7b93648
[agent] test(orchestrator): classifier integration tests + force_exha…
AlexMikhalev Apr 20, 2026
348cb70
[agent] style(orchestrator): apply cargo fmt - Refs terraphim/adf-fle…
AlexMikhalev Apr 20, 2026
afbd4af
fix(sessions): drop redundant map().flatten() chain in aider connector
Apr 20, 2026
7c06836
Merge pull request 'Fix #9: migration script for conf.d/ layout' (#62…
AlexMikhalev Apr 20, 2026
45d1637
Merge pull request 'Fix #7: per-provider error-signature matchers (th…
AlexMikhalev Apr 20, 2026
d825fcc
[agent] feat(adf-setup): project-meta + fleet-meta prompts in example…
AlexMikhalev Apr 20, 2026
01079ee
[agent] feat(orchestrator): pause flag gate + project circuit breaker…
AlexMikhalev Apr 20, 2026
cc15f19
[agent] feat(spawner): support bash/sh cli_tool via -c - Refs terraph…
AlexMikhalev Apr 20, 2026
78e1281
[agent] test(orchestrator): pause flag + project circuit breaker - Re…
AlexMikhalev Apr 20, 2026
d8d49ef
Merge pull request 'Fix terraphim/adf-fleet#8: meta-prompts (project-…
AlexMikhalev Apr 20, 2026
bbc8755
feat(drift-detector): agent work [auto-commit]
AlexMikhalev Apr 20, 2026
64af819
feat(security-sentinel): agent work [auto-commit]
AlexMikhalev Apr 20, 2026
91d5ba7
feat(drift-detector): agent work [auto-commit]
AlexMikhalev Apr 20, 2026
6efeca3
feat(security-sentinel): agent work [auto-commit]
AlexMikhalev Apr 20, 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
20 changes: 12 additions & 8 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
ignore = [
"RUSTSEC-2024-0370",
"RUSTSEC-2023-0071",
# RUSTSEC-2026-0049: rustls-webpki CRL revocation bypass
# RUSTSEC-2026-0049: rustls-webpki CRL revocation bypass (old advisory, superseded)
# See RUSTSEC-2026-0098 and RUSTSEC-2026-0099 below for current advisories.
"RUSTSEC-2026-0049",
# RUSTSEC-2026-0098 and RUSTSEC-2026-0099: rustls-webpki name constraint bypasses
# - Package: rustls-webpki 0.102.8
# - Dependency chain: serenity -> tokio-tungstenite -> tokio-rustls -> rustls 0.22 -> rustls-webpki 0.102
# - Dependency chain: serenity 0.12.5 -> tokio-tungstenite 0.21 -> rustls 0.22.4 -> rustls-webpki 0.102.8
# - serenity is an OPTIONAL dependency, only activated with `--features discord` in terraphim_tinyclaw
# - discord feature is NOT in default features; the vulnerable code is not built by default
# - serenity 0.12.5 is the latest stable; requires serenity 0.13+ (unreleased) for rustls 0.23+
# - rustls 0.22.x requires rustls-webpki ^0.102 (semver incompatible with 0.103.x patch)
# - Mitigation: discord feature disabled by default, patch attempted in Cargo.toml [patch.crates-io]
# - Resolution: Remove once serenity 0.13+ releases with rustls 0.23+ support
"RUSTSEC-2026-0049",
# - discord feature is NOT in default features; the vulnerable code path is not compiled by default
# - serenity 0.12.5 is the latest stable version; no serenity release uses rustls 0.23+/webpki 0.103+
# - rustls 0.22.x requires rustls-webpki ^0.102 (semver-incompatible with the 0.103.12 fix)
# - Cargo.toml [patch.crates-io] can only patch same semver series (0.103.x), not 0.102.x
# - Resolution: Remove when serenity 0.13+ releases with rustls 0.23+ support, or remove Discord
"RUSTSEC-2026-0098",
"RUSTSEC-2026-0099",
]
316 changes: 316 additions & 0 deletions .docs/implementation-plan-pr-backlog-2026-04-09.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,316 @@
# Implementation Plan: PR Backlog Prioritization & Merge Strategy

**Status**: Draft
**Research Doc**: `.docs/research-pr-backlog-2026-04-09.md`
**Author**: AI Analysis
**Date**: 2026-04-09
**Estimated Effort**: 3-4 hours (execution time, not including verification)

## Overview

### Summary
Execute a 5-phase strategy to clear the 17-open-PR backlog by consolidating duplicates, merging security/compliance fixes first, then proceeding to infrastructure (without Tauri) and feature work in dependency order. **Tauri is being moved to terraphim-ai-desktop repository.**

### Approach
1. Reconcile Gitea PR state with actual branch state
2. Close duplicate PRs to prevent merge conflicts
3. Execute merge in priority order (security → compliance → bugfixes → features)
4. Tauri-related PRs (#491) to be closed - Tauri moves to terraphim-ai-desktop

### Scope

**In Scope:**
- 17 open PRs across GitHub and Gitea
- Duplicate identification and closure
- Merge sequence execution (5 phases, Tauri removed)
- CI verification

**Out of Scope:**
- Tauri desktop application (moving to terraphim-ai-desktop)
- Investigating why duplicates were created
- Refactoring ADF swarm architecture
- Adding new features not in backlog

**Avoid At All Cost:**
- Merging duplicates before closing originals (would cause conflicts)
- Skipping security PRs for "faster" feature work
- Ignoring CI failures to "get things done"
- Merging Tauri-related PRs here (belongs in terraphim-ai-desktop)

## Architecture

### Merge Flow Diagram
```
┌─────────────────────────────────────────┐
│ PHASE 1: CLEANUP │
│ Close duplicates (#496, #503, #776) │
│ Close #491 (Tauri → desktop repo) │
└─────────────────┬───────────────────────┘
┌─────────────────────────────────────────┐
│ PHASE 2: SECURITY (Priority) │
│ #486 RUSTSEC + Ollama binding │
│ #412 Compliance verification │
└─────────────────┬───────────────────────┘
┌─────────────────────────────────────────┐
│ PHASE 3: COMPLIANCE │
│ #493 Consolidate license fixes │
└─────────────────┬───────────────────────┘
┌─────────────────────────────────────────┐
│ PHASE 4: BUGFIXES │
│ #475, #477, #508, #512 │
└─────────────────┬───────────────────────┘
┌─────────────────────────────────────────┐
│ PHASE 5: FEATURES │
│ #520, #405, #519 │
└─────────────────────────────────────────┘
```

### Key Design Decisions

| Decision | Rationale | Alternatives Rejected |
|----------|-----------|----------------------|
| Security first | RUSTSEC is active CVE | Features first (rejected - security debt) |
| Close duplicates before merge | Prevent merge conflicts | Merge all, resolve conflicts (rejected - wasteful) |
| Tauri removed from repo | Moving to terraphim-ai-desktop | Keep here (rejected - bloat, separate concerns) |
| Consolidate license PRs | 3 PRs same fix | Merge all 3 (rejected - conflicts) |

### Eliminated Options

| Option Rejected | Why Rejected | Risk of Including |
|-----------------|--------------|-------------------|
| Merge all PRs simultaneously | Would cause massive conflicts | Unreleasable state |
| Ignore duplicate PRs | Merge conflicts inevitable | Wasted CI cycles |
| Skip CI verification | Security regressions possible | Production vulnerabilities |
| Merge GitHub #776 separately | Duplicate of Gitea #520 | Confusing state |

### Simplicity Check

**What if this could be easy?**
- Just close obvious duplicates first
- Run `cargo audit` and `cargo deny` to verify security
- Use tea CLI one-liners for merges
- If CI passes, merge; if not, debug

**Answer**: The plan IS simple. The execution is just methodical.

## File Changes

This plan does not modify source code. It coordinates GitHub/Gitea PR state.

### Git Operations

| Action | Branch | Purpose |
|--------|--------|---------|
| Reconcile state | main | Verify PR vs branch state |
| Push cleanup | main | Sync reconciled state |

### External State Changes (GitHub/Gitea)

| PR | Action | Command |
|----|--------|---------|
| GitHub #776 | Close (duplicate) | `gh pr close 776` |
| GitHub #775 | Close (already merged) | `gh pr close 775` |
| Gitea #491 | Close (Tauri moved) | `tea pulls close 491` |
| Gitea #496 | Close (duplicate) | `tea pulls close 496` |
| Gitea #503 | Close (duplicate) | `tea pulls close 503` |

## API Design

### tea/Gitea CLI Commands

```bash
# Close duplicate PRs
tea pulls close {496,503} --repo terraphim/terraphim-ai

# Merge PRs
tea pulls merge {ID} --repo terraphim/terraphim-ai

# Check PR status
tea pulls list --repo terraphim/terraphim-ai --state open
```

### gh/GitHub CLI Commands

```bash
# Close duplicate PRs
gh pr close 776 --repo terraphim/terraphim-ai
gh pr close 775 --repo terraphim/terraphim-ai

# Check PR status
gh pr list --repo terraphim/terraphim-ai --state open
```

## Test Strategy

### Pre-Merge Verification

| Test | Command | Pass Criteria |
|------|---------|---------------|
| Cargo audit | `cargo audit` | 0 vulnerabilities |
| Cargo deny | `cargo deny check licenses` | 0 failures |
| Clippy | `cargo clippy --workspace` | 0 warnings |
| Format | `cargo fmt -- --check` | 0 failures |
| Build | `cargo build --workspace` | Compiles |

### Post-Merge Verification

| Test | Purpose |
|------|---------|
| CI pipeline | All GitHub Actions pass |
| gitea-robot ready | Next PR becomes "ready" |

## Implementation Steps

### Step 1: Reconcile PR State
**Purpose**: Verify which PRs are actually open vs already merged
**Command**: `git log --oneline --all | head -50`
**Estimated**: 15 minutes

### Step 2: Close GitHub Duplicates
**Files**: GitHub remote
**Description**: Close GitHub PRs that duplicate Gitea work
**Commands**:
```bash
gh pr close 776 --repo terraphim/terraphim-ai --comment "Duplicate of Gitea #520"
gh pr close 775 --repo terraphim/terraphim-ai --comment "Already merged in main"
```
**Estimated**: 5 minutes

### Step 3: Close Gitea Duplicates
**Files**: Gitea remote
**Description**: Close Gitea PRs that are duplicates
**Commands**:
```bash
tea pulls close 496 --repo terraphim/terraphim-ai --comment "Duplicate of #493"
tea pulls close 503 --repo terraphim/terraphim-ai --comment "Duplicate of #493"
```
**Estimated**: 5 minutes

### Step 4: Merge Security PRs
**Files**: Gitea remote
**Description**: Merge RUSTSEC and compliance PRs
**Commands**:
```bash
# Verify first
cargo audit
cargo deny check licenses

# Then merge
tea pulls merge 486 --repo terraphim/terraphim-ai
tea pulls merge 412 --repo terraphim/terraphim-ai
```
**Estimated**: 30 minutes (including verification)

### Step 5: Merge Compliance PR
**Files**: Gitea remote
**Description**: Merge consolidated license fix
**Commands**:
```bash
tea pulls merge 493 --repo terraphim/terraphim-ai
```
**Estimated**: 10 minutes

### Step 6: Merge Bugfix PRs
**Files**: Gitea remote
**Description**: Merge low-risk bugfixes
**Commands**:
```bash
tea pulls merge 475 --repo terraphim/terraphim-ai
tea pulls merge 477 --repo terraphim/terraphim-ai
tea pulls merge 508 --repo terraphim/terraphim-ai # if still open
tea pulls merge 512 --repo terraphim/terraphim-ai # if still open
```
**Estimated**: 20 minutes

### Step 7: Close Tauri PR
**Files**: Gitea remote
**Description**: Tauri being moved to terraphim-ai-desktop
**Commands**:
```bash
tea pulls close 491 --repo terraphim/terraphim-ai --comment "Tauri moving to terraphim-ai-desktop repository"
```
**Estimated**: 5 minutes

### Step 8: Merge Feature PRs
**Files**: Gitea remote
**Description**: Merge final wave of features
**Commands**:
```bash
tea pulls merge 520 --repo terraphim/terraphim-ai # ValidationService
tea pulls merge 405 --repo terraphim/terraphim-ai # Phase 7 (verify phase completion first)
tea pulls merge 519 --repo terraphim/terraphim-ai # Token tracking
```
**Estimated**: 45 minutes

### Step 9: Final Verification
**Purpose**: Ensure main is clean and pushable
**Commands**:
```bash
git pull --rebase gitea main
cargo build --workspace
cargo test --workspace
git push gitea main
```
**Estimated**: 30 minutes

## Rollback Plan

If issues discovered during merge:
1. Stop immediately - do not continue to next PR
2. Revert last merge: `git revert HEAD && git push gitea`
3. Debug issue before resuming
4. Use `git stash` if needed to isolate work

Feature flag: N/A (PR-level, not code-level)

## Migration

N/A - this is a PR coordination plan, not a code migration

## Dependencies

### New Dependencies
None - uses existing tea/gh CLI tools

### Dependency Updates
None

## Performance Considerations

### Expected Performance
| Metric | Target | Measurement |
|--------|--------|-------------|
| Time to clear backlog | < 1 week | From now to all PRs closed/merged |
| CI pass rate | 100% | All merged PRs pass CI |
| Merge conflicts | 0 | Confirmed by closing duplicates first |

## Open Items

| Item | Status | Owner |
|------|--------|-------|
| Verify #508, #512 actual state | Pending | Git history check |
| Confirm #516 blocks #520 | Pending | Issue investigation |
| Verify #405 phase completion | Pending | Review phase criteria |
| Tauri moved to terraphim-ai-desktop | Confirmed | terraphim-ai-desktop repo |

## Approval

- [ ] Research document reviewed and approved
- [ ] Implementation plan reviewed and approved
- [ ] Human approval received
- [ ] Execution can begin

## Summary

| Phase | PRs | Action | Est. Time |
|-------|-----|--------|-----------|
| 1 | Duplicates + Tauri | Close 5 PRs | 20 min |
| 2 | Security (#486, #412) | Merge | 30 min |
| 3 | Compliance (#493) | Merge | 10 min |
| 4 | Bugfixes (#475, #477, #508, #512) | Merge | 20 min |
| 5 | Features (#520, #405, #519) | Merge | 45 min |
| **Total** | | | **~2.5 hours** |
Loading