Skip to content

feat: integrate Brainwares CLI backend & centralized Promptwares vaults#1672

Draft
rorychatt wants to merge 78 commits into
developmentfrom
epic/brainwares
Draft

feat: integrate Brainwares CLI backend & centralized Promptwares vaults#1672
rorychatt wants to merge 78 commits into
developmentfrom
epic/brainwares

Conversation

@rorychatt

@rorychatt rorychatt commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Centralized Vault Migration & CLI Resolution

  • Support project repository (e.g. ~/.tendril/Promptwares/memories/coalmininggame/project-stack.md).
  • Implemented a recursive directory scanner load_memories and find_markdown_files to load all nested memories and prefix their names with their parent subdirectory (e.g. coalmininggame/project-stack).
  • Added automatic subfolder note resolution fallbacks in resolve_memory_path and handle_add inside the CLI based on the active Git repository directory name, allowing seamless bw read project-stack or bw update project-stack calls from inside a repo root.

3. Rust CLI Workspace Resolution Updates

  • Updated get_workspace_root inside brainwares/src/vault.rs to find the workspace/repository root by walking up from the current working directory to find a .git folder rather than assuming the parent of the vault path is the workspace root.
  • Added a fallback search in find_vault_path to locate the global ~/.tendril/Promptwares vault centrally if no local candidate is found.
  • Recompiled and reinstalled the updated Rust binary to ~/.cargo/bin/bw.

4. Dynamic Workspace & Active Project Directory Resolution

  • Fixed a path resolution bug in LibraryApp.cs and PromptwareRunner.cs where workingDir was mapped to the parent directory of the repository instead of the repository root itself.
  • Updated LibraryApp.cs to dynamically resolve the active project (e.g. coalmininggame) matching the current working directory. This ensures UpdateMemories jobs are launched with the correct repository namespace instead of fallback \"Auto\".
  • Added directory filtering to ResolveBrainwaresVaultDir to ignore the deployed promptware template directory ~/.tendril/Promptwares.

5. PowerShell Elimination & Inline C# MSBuild Task

  • Removed packaging script dependencies on PowerShell by implementing an inline C# MSBuild compilation task within Ivy.Tendril.csproj to compress templates on build.
  • Deleted legacy pack-promptwares.ps1 and DeleteMemory.ps1 scripts.
  • Enabled promptwares packaging for all build configurations (including Debug) to make update-promptwares fully functional during local development.

6. Centralized & Unified Promptware Memories

  • Migrated promptware-specific memory directories from isolated template folders (~/.tendril/Promptwares/<PromptwareName>/Memory/) to the repository-specific central vault subfolders:
    ~/.tendril/Promptwares/memories/<repo-name>/promptware/
  • Built on-demand default memory syncing inside PromptwareHelper.ResolveMemoryDirectory to populate a project's promptware folder automatically from templates if a note is missing.
  • Created a startup migration pipeline SyncPromptwareMemoriesToCentralVault to recursively copy and initialize promptware notes for existing projects and global fallbacks.
  • Makes all promptware notes fully visible, searchable, and editable under the Library tab (e.g., listed as coalmininggame/promptware/plans or global/promptware/cli-quirks).

7. Memory Types (File-based vs. User-based) & Hash Invalidation

  • Added structured support for memory types in brainwares: MemoryType::File (material files tied to repository source code) and MemoryType::User (generic knowledge notes).
  • Integrated automatic code file hash checking inside bw status and bw read <name>. Running bw read on a file-based memory note dynamically calculates linked file hashes and prints a WARNING banner if code updates have caused the memory to become outdated.

8. Bidirectional Memory Relations & CLI Command

  • Implemented the bw relate <memory> <target> (and --remove) subcommand. This builds a bidirectional graph by establishing a relations: [...] array inside the frontmatter of memory files.
  • Obsoleted inline body-based double-bracket [[wiki-links]] for establishing dependency maps.
  • Updated bw status to check both frontmatter relations and inline legacy wiki-links for broken links, and updated get_backlinks to index both sources cleanly.
  • Updated ContentView.cs to deserialize and render frontmatter relations inside the ECharts BrainMap graph, resolving the problem where relations between memory pages were no longer shown.
  • Automatically synchronized rules files (AGENTS.md, CLAUDE.md, etc. via bw integrate) and the UpdateMemories prompt instructions to mandate using the bw relate CLI instead of inline markdown wiki-links.

9. Whitespace-Tokenized Search Querying

  • Upgraded bw query to split search terms on whitespace, ensuring all parsed tokens match either the note's name, title, tags, or body content, and sorting matching pages by relevance score.

UX / UI & Agentic Feature Enhancements

10. Library Search & Suffix Refactoring

  • Relocated the new memory note (+) button from a separate row/layout cell in the Library sidebar into the search input component's .Suffix() slot:
    var sidebarHeader = Layout.Vertical()
        | searchQuery.ToSearchInput()
            .Placeholder("Search memories...")
            .Suffix(
                new Button()
                    .Icon(Icons.Plus)
                    .Ghost()
                    .OnClick(() => isNewNoteOpen.Set(true))
            );

11. Recursive Memories Scanning in Library UI

  • Replaced the top-level-only search Directory.GetFiles(memoriesDir, "*.md") inside LibraryApp.cs with a recursive directory lookup using SearchOption.AllDirectories.
  • Computes clean relative paths for nested memories (e.g. coalmininggame/project-stack) so they render seamlessly in the Library sidebar list.

12. Project Filter Dropdown in Sidebar

  • Added a projectFilter dropdown using ToSelectInput to the Library sidebar. Selecting a project dynamically filters the list of memories and ECharts BrainMap graph nodes/edges by project folder, supporting cleaner per-project context auditing.

13. Living Memory Vault (Planner & Executor Integration)

  • CreatePlan: Instructs the planner agent to run bw status and query/read relevant memory notes during the research stage. Optionally prompts the agent to add design notes (e.g., bw add design-<plan-id>) to document architectural decisions.
  • ExecutePlan: Instructs the executor agent to run bw status before worktree creation, and run a maintenance phase at the end of execution to update outdated hashes (bw update) and link new files (bw link) automatically.

14. Agentic Memory Updater (Selected Files)

  • Introduced a new background job type UpdateMemories with UpdateMemoriesArgs carrying selected repository files to document.
  • Added a new promptware template under Promptwares/UpdateMemories/ instructing the AI agent to systematically scan source codes, generate corresponding markdown notes in the Promptwares vault, link references (bw link), and sync hashes (bw update).
  • Added an interactive Agentic Update button in the Library Tab toolbar which triggers UpdateMemoriesDialog to filter and select files from the active repository (using git ls-files) and queue background jobs. These run in the standard Tendril Jobs interface with live output feeds.

15. AI Edit Memory Dialog & Job

  • Added a new background job type EditMemory (with EditMemoryArgs) which targets a specific memory note and takes custom instructions from the user.
  • Added a new promptware template under Promptwares/EditMemory/ instructing the AI agent to read the memory note, read referenced code if any, modify the note based on user instructions using bw write, sync reference hashes (bw update), and run bw status.
  • Created an AI Edit button in the memory view footer (alongside Edit and Delete) that opens AiEditMemoryDialog to capture user instructions/prompt and submit it as a background job.

App Categorization, Connections & Workflows (New Features)

16. App Categorization and Styling Rules

  • Organized the sidebar apps into main categories: Orchestration, Automations, Connections, Memory, and Overview.
  • Banned custom paddings/margins in C# code layout components to strictly adhere to design layout spacing systems.

17. Connections Integration (Third-Party APIs)

  • Added database migrations and services for storing integrations.
  • Built the Connections App view with connectors for Slack, Discord, and GitHub.

18. Workflows Automation & Canvas Builder

  • Built a visual Workflow Builder React widget canvas for drawing workflows.
  • Implemented the workflow runner in C# (JobLauncher) supporting Connection steps, Prompt steps, and custom dispatches.

19. Multi-Tab Chat Session Manager & Spooling Spawners

  • Refactored AgentApp into a tabbed chat interface.
  • Spawns coding agent tools (e.g. claude) directly as local subprocesses, piping real-time output straight to PTY terminal or conversational streams.
  • Added safe JSX key rendering in RichTextBlockWidget.tsx to prevent null-property crashes.

20. Plan Diff, Review, and Express Validation

  • Built an interactive PlanDiffView React widget, review dialogs, and Express validation mode with test coverage.
  • Integrated builtin promptwares and ECharts BrainMap bidirectional relation graph node mappings.

System Workflows, Layout Builder & Jobs Filtering

21. System Workflows and Core Lifecycle

  • Introduced the concept of read-only System Workflows (IsSystem property) with a database migration.
  • Scaffolded a default system workflow "Tendril Core Lifecycle" loaded automatically on startup mapping out draft planning, reviews, implementations, verifications, and pull requests.
  • Prevented modifications to system workflows, offering a "Clone" workflow action button in place of the default "Save".

22. Inline Promptware Inspector & Node Selection

  • Implemented node selection in the visual Workflow Builder canvas (OnNodeSelect).
  • Added an inline Promptware Inspector panel to browse through prompt files (Program.md and related C# or Python scripts in Tools/) directly within the canvas.

23. Advanced Jobs Filtering

  • Added Type and Status selectors to the Jobs App dashboard, enabling real-time filtering of active and archived runs.

24. Layout Padding Rules Compliance

  • Enforced strict UI styling spacing regulations by removing parent padding configurations in ConnectionsApp and AgentApp layouts.

System Workflows Deduplication & Webhook Triggers

25. Webhook Triggers inside visual Workflow Builder

  • Added visual card configuration displaying local API endpoints /api/jobs and payload details for webhook type triggers.
  • Prevented deletion of trigger nodes unless multiple triggers are placed.
  • Collapsed accordion tabs by default to clean up initial visual noise on load.

26. Deduplicate System Workflows

  • Added database migration version 22 to delete project-specific duplicate records of system workflows.
  • Updated WorkflowsApp to restrict automatic seeding to non-system project-specific workflows on project filtering.
  • Refactored GetWorkflows queries to pull both current project-scoped workflows and global system-wide lifecycle templates, resolving the bug where system workflows would disappear under active filters.

27. Job Metadata & Project Scoping

  • Fixed a bug where background runs (like promptwares, workflow dispatches, memory sync updates) were misattributed to project namespace "Auto" on the main dashboard logs.
  • Enriched JobService.cs project mapping to parse and match active database context for custom runner dispatches.

Timed Triggers & Tendril Event Triggers

28. Timed (Cron) and Event-based Workflow Triggers

  • Implemented WorkflowTriggerService starting a timer evaluation checking for active crons (e.g. */5 * * * * matching active UTC minutes).
  • Registered WorkflowTriggerService as a singleton in ServiceRegistration.cs listening to file workspace watch events.
  • Updated PrStatusSyncService to invoke WorkflowTriggerService.CheckAndTriggerPlanCompletedAndMerged when PR status changes to "Merged".
  • Enabled event selection dropdowns and timed cron input cards dynamically inside the visual React Workflow Builder canvas, resolving missing configuration fields on trigger setups.

Natural Language Connections & Dynamic Canvas Sizing

29. Auto-Translation of Natural Language Arguments in Workflows

  • Added detection in JobLauncher.cs for connection step arguments that are written in natural language (non-JSON text).
  • Spawns a translation agent run (e.g. claude) to translate natural language inputs into structured parameter JSON objects matching the connection provider's target schema (Slack, Discord, or GitHub).
  • Preserves context outputs from previous workflow steps, allowing the translation agent to resolve references (e.g., "post the findings from step 1").

30. Dynamic Canvas Card Sizing in Workflow Builder

  • Replaced hardcoded static heights for trigger, prompt, and connection cards in CSS with a dynamic ResizeObserver layout inside React WorkflowBuilder.tsx.
  • Ensures connection ports and lines align perfectly with cards as input controls expand and collapse.
  • Updated BrainMap.tsx category labels layout to resolve dynamically.

31. Workflow Trigger Service Unit Tests & Immediate Filters Update

  • Added WorkflowTriggerServiceTests.cs validating cron expressions (e.g. weekly schedules) and event-based plan completed dispatches.
  • Pre-seeded project list directories from config.yaml inside PromptwareHelper.cs to ensure folders are initialized dynamically.
  • Added instant data table refresh trigger on Jobs App filters selection update.

Filesystem Connections & Advanced Plan Diff Reviewed Checking

32. Filesystem Connections (YAML Migration)

  • Migrated third-party connection provider settings (Slack, GitHub, Discord) out of SQLite database to camelCase YAML files inside the connections/ subfolder.
  • Added reflection-based discovery of all connection providers in Program.cs and ServiceRegistration.cs to eliminate hardcoded provider mappings.
  • Enriched connections app sidebar menus and catalog interfaces to display provider descriptions and icons.

33. Inline Code Editing & Git Commits from Diff

  • Implemented OnDirectEdit in PlanDiffView.tsx and C# ChangesTabView.cs enabling direct inline code line editing in the diff view.
  • Automatically writes edits to disk, stages the changes, and commits them via Git directly to the active branch.

34. GitHub-style Viewed Checkboxes & progress indicators

  • Added "Viewed" checkboxes to let users collapse reviewed files inside the diff view.
  • Displays total additions/deletions counts and colored progress squares matching the magnitude of changes per file.

Chat Renaming & Extended Diff File Management Actions

35. Simplified App Naming

  • Renamed all occurrences of "Agent App" to "Chat" inside the codebase UI tabs and helper classes for a cleaner visual layout.
  • Safely handled agent display name lookups within plan generation menus.

36. Extended Diff File Management Actions (View, External Edit, & Git Delete)

  • Implemented a header action dropdown menu for each file inside the Plan Diff view.
  • Hooks up three major actions:
    • View file: Opens the target file directly in the web application tab view.
    • Edit file: Automatically launches the local terminal/system editor (e.g. VS Code, Rider) for the target file path.
    • Delete file: Deletes the file, stages the delete via git rm, and commits the deletion to the branch immediately.

37. Detailed Workflow Jobs Status Titles

  • Enriched the jobs list dashboard item rendering in JobService.cs to dynamically append the cron schedule or merged plan titles onto background workflow dispatches (e.g., Run workflow: Deploy (Plan merged: Add login screen)).

Workflow Cancellation and Event Trigger Conditions

38. Nested Sub-Job Cancellation Support

  • Updated JobLauncher.cs step-execution queue loop to continuously monitor cancellation tokens on active parent jobs.
  • Automatically halts active child tasks (like natural language connection translations and agent runs) when the parent workflow is cancelled by the user.

39. Interactive Graph Watermark, Gutter Columns, & Vault Cleaning

  • Added floating active memory counters watermark overlays inside React BrainMap.tsx.
  • Dynamically hides empty additions/deletions line number gutters in unified plan diff views when files are purely added or deleted.
  • Deletes cluttered workspace memory folders (e.g. deep, Epic, Chore, antigravity) automatically inside PromptwareHelper.cs and refactored config loaders to parse YAML safely via TendrilSettings.

Promptwares Brainwares Integration Updates

40. Promptwares Namespace-Aware Vault Actions

  • Updated prompt templates in CreatePr, Documentation, and ExecutePlan to consistently pass the --project <TendrilProject> flag to the bw CLI tool.
  • Mandated reading and writing of vault notes strictly through bw read and bw write CLI subcommands rather than directly modifying the filesystem, ensuring correct relative scoping and namespace hashing.
  • Outlawed Obsidian-style inline body [[wiki-links]] across all prompt structures, requiring using the bw relate CLI instead.

rorychatt added 14 commits July 12, 2026 16:46
…mmands to bw CLI and update sandbox permissions
… back to global brainwares memories and add global sandbox permissions
…and project-add vault auto-initialization hooks
@rorychatt rorychatt changed the title Epic/brainwares feat: integrate Brainwares CLI backend & centralized Promptwares vaults Jul 12, 2026
rorychatt added 15 commits July 12, 2026 20:48
…te, and maintain memories during plan creation and execution
…idget and restyled layout with switch toggle and inline actions
…r namespaces, and update promptwares to cross-reference dependencies/tests
rorychatt added 22 commits July 17, 2026 14:31
…ares and fix local sandbox in test environments
…n Workflow Builder and runtime dispatch service
@artem-ivy-ai

Copy link
Copy Markdown

Staging preview

📄 Docs: https://ivy-tendril-staging-docs-1672.sliplane.app

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