Skip to content

feat(orchestrator): close the loop on compound review findings#756

Merged
AlexMikhalev merged 30 commits intomainfrom
feature/warp-drive-theme
Apr 4, 2026
Merged

feat(orchestrator): close the loop on compound review findings#756
AlexMikhalev merged 30 commits intomainfrom
feature/warp-drive-theme

Conversation

@AlexMikhalev
Copy link
Copy Markdown
Contributor

This PR implements automatic issue filing and remediation agent spawning for compound review findings.

Changes

GiteaTracker (terraphim_tracker)

  • Added create_issue() method for creating Gitea issues via API
  • Added search_issues_by_title() for deduplication before filing

OutputPoster (terraphim_orchestrator)

  • Added post_raw() for posting arbitrary markdown to Gitea
  • Added tracker() accessor for underlying GiteaTracker

CompoundReviewConfig (terraphim_orchestrator)

  • gitea_issue: Target issue for posting review summaries
  • auto_file_issues: Auto-file issues for CRITICAL/HIGH findings
  • auto_remediate: Spawn remediation agents for CRITICAL findings
  • remediation_agents: Map finding categories to agent names

CompoundReviewResult (terraphim_orchestrator)

  • format_report(): Structured markdown summary for Gitea
  • actionable_findings(): Extract CRITICAL/HIGH severity findings

Orchestrator Integration

  • Posts structured compound review summary to configured Gitea issue
  • Deduplicates findings before filing (searches existing open issues)
  • Files individual Gitea issues for each CRITICAL/HIGH finding
  • Spawns remediation agents when auto_remediate = true

Testing

  • All 290 unit tests pass
  • Deployed to bigbox with auto_file_issues = true

Configuration Example

[compound_review]
gitea_issue = 108
auto_file_issues = true
auto_remediate = false

[compound_review.remediation_agents]
security = "security-patcher"
quality = "code-fix-agent"

Refs #242

Terraphim CI and others added 30 commits April 3, 2026 22:13
…ence Refs #242

- New learning.rs module with LearningPersistence trait
- InMemoryLearningPersistence for testing (7 tests pass)
- DeviceStorageLearningPersistence using terraphim_persistence opendal Operator
- SharedLearningStore high-level API with context file generation and JSONL import
- Trust levels L0-L3 with auto-promotion on effective application
- No direct rusqlite dependency; uses terraphim_persistence storage abstraction
Mobile-first custom Zola theme based on Proposal E design:
- OKLCH colour scheme (deep void navy + warp blue)
- Space Grotesk/Onest/JetBrains Mono typography
- Canvas warp tunnel animation with scroll-driven speed
- Responsive topbar nav with Terraphim logo branding
- Homepage: hero, stats, capabilities, comparison, systems, roles, deploy, install CTA
- Blog/docs: dark panel cards, prose styling, tags/categories pages
- 2K display support (1800px+ breakpoint with scaled fonts)
- Retains elasticlunr search, Google Analytics, Cloudflare Pages deploy
- Old DeepThought templates preserved as .deepthought-bak files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sizes, remove AI-generated posts

- Comparison table: fixed column widths (60/20/20), larger fonts, table-layout:fixed
- Post cards: increased title/summary/meta/tag font sizes for readability
- Prose: bumped base from 0.9rem to 1rem, with 2K scaling to 1.15rem
- Removed 7 auto-generated blog posts (converted from dev sessions by AI agents)
- Only genuine posts remain: "Announcing Terraphim AI" and "Teaching AI Coding Agents"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
opencode manages its own provider auth via ~/.config/opencode/opencode.json.
It supports Kimi/Moonshot, Anthropic, MiniMax, etc. -- none of which use
OPENAI_API_KEY. The validation gate was preventing all opencode agents from
spawning on bigbox where no OpenAI key is configured.

Refs #232
Root cause analysis of the Apr 3 mention replay storm (load 301).
Design follows Issue #186 with additions:
- max_dispatches_per_tick rate limit
- max_concurrent_mention_agents cap
- Startup guard (cursor=now on first run)
- Eliminates watch_issues config and processed HashSet

Supersedes #249.
Notifications API rejected: no comment bodies, aggregates by issue,
requires N extra API calls. Repo-wide comments API remains the choice.
…tion

Align all section headings (overline, title, subtitle) to centre consistently
across Core Capabilities, Comparison, Ship Systems, Roles, Deploy, and Install
sections. Card content within grids remains left-aligned for readability.

Replace single curl install command with 6-platform install grid covering
macOS (Homebrew), Linux (curl), Cargo, NPM, Python (pip), and Windows
(winget), with responsive layout (1-col mobile, 2-col tablet, 3-col desktop).

Also increases TOC sidebar font size from 0.7rem to 0.8rem.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces per-issue comment polling with single repo-wide API call using
Gitea's ?since= cursor parameter. Eliminates mention replay storm on restart.

Changes:
- MentionCursor: persistent cursor via terraphim_persistence (load_or_now)
- MentionTracker: simplified to per-issue dispatch counter (no HashSet)
- fetch_repo_comments: new GiteaTracker method for repo-wide comment API
- IssueComment: added issue_number field for repo-wide comment parsing
- MentionConfig: max_dispatches_per_tick (3), max_concurrent_mention_agents (5)
- poll_mentions(): rewritten to use cursor, bounded concurrency
- ManagedAgent: added spawned_by_mention flag for concurrency tracking

Startup guard: on first run (no cursor), sets cursor=now to skip backlog.
Backward compat: old watch_issues config still accepted but ignored.

12 tests pass (4 new cursor/tracker tests).

Refs #186, closes #249
Gitea rejects timestamps with space-separated timezone offset.
Use to_rfc3339_opts(Secs, true) to produce '2026-04-03T23:29:27Z' format.
fastest_op was picking dashmap (in-memory only), so cursor was never
persisted across restarts. Use explicit sqlite operator lookup.
Gitea sends created_at as '2026-04-03T02:00:25+02:00' but since=
parameter expects '2026-04-03T00:00:00Z'. advance_to() now converts
all timestamps to UTC Z before storing.
Two fixes for overnight agent productivity:

1. Post-exit auto-commit: after any agent exits 0, orchestrator runs
   git add -A && git commit to preserve working tree changes.
   Previously agents wrote code but never committed it.

2. Compound review output parser: unwraps opencode JSON protocol
   before parsing ReviewAgentOutput. opencode --format json wraps all
   output as {type:text,part:{text:...}} which the parser couldn't
   see. Also adds heuristic fallback to extract findings from
   unstructured markdown reports (CVE mentions, CRITICAL keywords).

35 compound tests pass.
- Add gitea_issue, auto_file_issues, auto_remediate, remediation_agents to CompoundReviewConfig
- Implement format_report() and actionable_findings() on CompoundReviewResult
- Add create_issue() and search_issues_by_title() to GiteaTracker
- Add post_raw() and tracker() methods to OutputPoster
- Post structured compound review summary to Gitea after review completes
- Auto-file Gitea issues for CRITICAL/HIGH findings with dedup
- Spawn remediation agents for CRITICAL findings
- Implement Default for CompoundReviewConfig

Refs #242
…ata command parser

- Add debug logging for compound review schedule diagnostics
- Implement terraphim-automata based AdfCommandParser for @adf: mentions
- Add manual trigger support via @adf:compound-review mention
- Post compound review summary to Gitea issue after completion
- Auto-file Gitea issues for CRITICAL/HIGH severity findings
- Add remediation agent spawning for CRITICAL findings (disabled by default)
- Deduplicate finding issues using search_issues_by_title
- Add create_issue and search_issues_by_title to GiteaTracker
- Add post_raw method to OutputPoster for arbitrary markdown posting

Refs #242, #186
GiteaIssue (pub) exposed GiteaLabel (private) via its pub labels field,
causing a private_interfaces lint failure with -D warnings in CI.

Refs PR #756

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documents the Gitea API 422 fix, command collision bug discovery,
and lessons learned from testing the compound review findings loop.

Refs #186
- Rename `labels` to `_labels` in gitea.rs to suppress unused var warning
- Apply cargo fmt to gitea_create_issue_test.rs
- Add dev-dependencies for integration tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…gineering skills

14-agent fleet across Safety/Core/Growth layers, each with:
- Persona-specific knowledge graphs (50 markdown files in data/kg/)
- terraphim-agent shell pre-checks for domain context injection
- In-task search instructions for runtime KG queries
- V-model skill chains per agent layer

New files:
- data/kg/{vigil,ferrox,carthos,lux,echo,conduit,meridian,mneme}/*.md
- terraphim_server/default/persona_roles_config.json (8 persona roles)

Modified:
- orchestrator.example.toml: 3 -> 14 agents with full wiring
- config.rs: add role_config_path field to OrchestratorConfig
- Tests updated for 14-agent config

Refs #756

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The secret detection was scanning whole files, triggering false positives
on pre-existing test fixture values like api_key = "..." in config.rs.
Now scans only added lines from the staged diff.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Strip JSON syntax chars from issue titles and escape markdown in bodies.
This fixes issue #276 where raw JSON was visible in the issue title.
Fix clippy failure in CI due to -D warnings treating dead code as error.
Fix clippy failure in CI due to -D warnings treating dead code as error.
@AlexMikhalev AlexMikhalev merged commit af1d157 into main Apr 4, 2026
11 checks passed
@AlexMikhalev AlexMikhalev deleted the feature/warp-drive-theme branch April 4, 2026 17:27
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