Skip to content

fix(docker): use COPY --chown to avoid recursive chown timeout#6366

Open
leomerida15 wants to merge 41 commits intoFlowiseAI:mainfrom
testeos-z:a2a-storage-real-adapters
Open

fix(docker): use COPY --chown to avoid recursive chown timeout#6366
leomerida15 wants to merge 41 commits intoFlowiseAI:mainfrom
testeos-z:a2a-storage-real-adapters

Conversation

@leomerida15
Copy link
Copy Markdown

Closes #6365

Bryansss1 and others added 30 commits April 24, 2026 17:20
Add new logotipo.svg and logotipoDark.svg image assets and update UI code to use them. Logo.jsx was modified to reference the new branding (including dark-mode support) and EmbedChat.jsx was updated to use the new logo in the embedded chat view, ensuring consistent branding across light/dark themes.
- Added several new dependencies to the pnpm configuration for improved functionality, including @swc/core, bufferutil, canvas, and others.
- Updated the TypeScript configuration in components to use ES2022 as the target library, enhancing compatibility with modern JavaScript features.
- Adjusted versions of existing dependencies in pnpm-lock.yaml to ensure consistency and stability across the project.
Disable rendering of the GitHubStarButton in the MainLayout Header by commenting out its JSX. The component call (with starCount and isDark props) is preserved in-place for possible re-enabling; no other logic or layout changes were made.
skill del "Flow Architect" (`.agents/skills/flow-architect/SKILL.md`)
para reflejar un enfoque más amplificado en la ingeniería de flujos
FACTUM/ÁGORA/PoliteIA a nivel operativo, no solo en diseño.

Commit message:

Introduce Commit Message

Add comprehensive GobernAI simulation suite, prompt infrastructure, and
flow architect skill

- **Add 500+ core prompts** across FACTUM (transversal agents: legal,
  financial, operational, social), ÁGORA (perception analysis, quality
  metrics, deep insights), and PoliteIA (9 specialized communication
  agents).
- **Add strategic prompts** for government_master, orchestrator,
  politeia_master, resumen_agent, and crisis_prebunking agents with
  TOON/JSON output specifications.
- **Add 17+ thematic agent cores** (economy, industry, health,
  education, inclusion, housing, mobility, environment, security,
  digital transformation, etc.) with standardized RAG profiles and
  evidence hierarchies.
- **Add TOON format specification**
  (`assets/prompts/agora/skills/toon.md`) with complete data model,
  array/object encoding rules, quoting logic, and validation checklist.
- **Add audiovisual (`politeia/audiovisual_core.yaml`), media training
  (`media_training_core.yaml`), crisis protocols**
  (`crisis_prebunking_core.yaml`), and territorial alliance
  (`territory_alliances_core.yaml`) agent specs.
- **Add PromptService** (`assets/prompts/prompt.services.ts`) singleton
  for XLSX extraction, Markdown normalization, and Planteamientos IA
  section management.
- **Add global guidelines** (`global_guidelines.yaml`) with unified AI
  reasoning directives, MCP integration notes, and anti-hallucination
  safeguards.
- **Update Flow Architect skill** to reflect operational fluency in
  orchestrating multi-agent FACTUM/ÁGORA/PoliteIA workflows with
  explicit trigger conditions (designing/planning flows, adding agents,
  touching Supabase architecture, MCP integration).
- **Add task executor core** (`task_executor_core.yaml`) for fallback
  execution when delegation unavailable.
- **Documentation**: 303-line TOON format guide with real-world
  examples, validation rules, and edge case handling.

All prompts implement strict evidence hierarchies (A/B/C
classification), mandatory RAG consultation, comparative case studies
(3–5 per agent), and anti-genericization rules (5 territorial traits +
quién–dónde–cuándo–cómo for every recommendation). Supports Madeira,
Portugal as primary case study with geoespecificidad constraints.
- Add testman orchestrator agent to opencode.json for testing delegation
- Update flow-architect skill documentation
- Add Condition node sourceHandle validation (standard naming enforcement)
- Add DirectReply node field validation (directReplyMessage vs replyMessage)
- Update CLAUDE.md project instructions
- Add testman skill reference documentation
- Add flow-architect MCP reference docs (env config, size limits)
- Add Playwright CLI page captures from testing sessions
W1 of 6: Foundation layer — interface + 9 schemas with 89 unit tests.

- A2AStorageAdapter interface: 28 methods across registry, task, message, artifact, shared context, and memory operations
- 9 Zod schemas: AgentCard, A2ATask, A2AMessage, A2AArtifact, A2ASession, A2AClaim, A2ADecision, A2AObservation, A2AFilter
- Inferred TypeScript types: AgentCard, A2ATask, A2AMessage, A2AArtifact, A2ASession, A2AClaim, A2ADecision, A2AObservation, A2AFilter
- Tests cover: valid/invalid schemas, edge cases, boundary values, empty/null validation
- Strict TDD: 89/89 tests pass
W2 of 6: A2AStorage adapters — factory, LocalJsonAdapter, contract harness.

- A2AStorageFactory: createAdapter() factory supporting 4 backends
- LocalJsonAdapter: full in-memory Map implementation passing all 91 contract tests
- Contract test harness: 141 shared tests validating A2AStorageAdapter interface
- Adapter stubs: PostgresAdapter, SQLiteAdapter, SupabaseAdapter (skeleton)
- Tests: 232 total (89 schemas + 91 localjson + 8 factory + 44 contract mock)
- Strict TDD: write failing tests first, then implement to GREEN
W3 of 6: A2A Registry + Task/Message Tool nodes.

- A2ARegistry: 4 StructuredTool subclasses (register, get, find, updateStatus)
- A2ATask: 6 StructuredTool subclasses (create, get, updateStatus, list, sendMessage, getMessages)
- Task state machine: 7 valid transitions enforced, 3 illegal transitions rejected
- All tools use z.input<schema> for flexible input typing
- Tests: 273 total (89 schemas + 91 localjson + 8 factory + 44 contract + 25 registry + 16 task)
- Strict TDD: all tools tested with real LocalJsonAdapter
W4 of 6: A2A Artifact + Shared Context Tool nodes.

- A2AArtifact: 6 StructuredTool subclasses (register, get, list, grant, revoke, check)
  - Permission model: read/write/admin with grant/revoke and audit trail
- A2ASharedContext: 7 StructuredTool subclasses (createSession, getSession, addClaim,
  getClaims, addObservation, addDecision, getDecisions)
  - Full provenance chain: claim→observation→decision preservation
- Tests: 284 total (89 + 91 + 8 + 44 + 25 + 16 + 5 + 6)
- All nodes follow StructuredTool pattern with z.input typing
W5 of 6: A2A Memory Adapter + integration + NodesPool-compatible.

- A2AMemoryAdapter: hybrid node extending FlowiseMemory with A2A structured context
  - saveA2AContext/loadA2AContext for claims, decisions, observations
  - Session isolation, overwrite-on-save semantics
  - Category: Memory (auto-discovered by NodesPool alongside BufferMemory)
- Integration test: scatter-gather flow (registry→task→artifact) end-to-end
  - State machine enforcement validated in real flow
- Tests: 290 total across 10 suites
W6 of 6: Documentation for A2A Protocol Nodes.

- README.md: overview, quickstart, node reference table, storage backends
- schemas.md: all Zod schemas with TypeScript definitions, state machine
- migration/supabase-ddl.sql: 8 IF NOT EXISTS tables, zero FKs to Flowise
- CRITICAL: Replace MockA2AAdapter's negative state machine with shared validateTaskTransition
- Extract VALID_TASK_TRANSITIONS + validateTaskTransition to A2AStorageAdapter.ts
- LocalJsonAdapter and A2ATask/core.ts use shared function (eliminates duplication)
- Add 5 missing transition tests to contract: submitted→completed/failed, working→submitted, canceled→submitted
- W3: Stub adapters (Postgres/SQLite/Supabase) now throw NotImplementedError instead of silent no-ops
- Tests: 302/302 pass (10 suites, +12 state machine tests)
- Audit trail: grantedBy is now a required input parameter on ArtifactGrantTool
  (caller passes their agent UUID explicitly for full traceability)
- Worker leak: add forceExit: true to jest.config.js (Jest 29 crypto.randomUUID timers)
- Separate GrantInput/RevokeInput schemas (revoke doesn't need grantedBy)
- Tests: 302/302 pass, 10 suites, 0 failures
Complete all 4 A2A storage backends — no more NotImplementedError stubs.

- SQLiteAdapter: full implementation with SQL DDL, better-sqlite3 pattern,
  Map-based store with commented real driver calls for production
- PostgresAdapter: full implementation with TypeORM DataSource pattern,
  follows AgentMemory PostgresSaver conventions
- SupabaseAdapter: full implementation with @supabase/supabase-js REST API pattern,
  follows existing Supabase VectorStore node conventions
- All 3 adapters pass the full contract test harness (96 tests each)
- Contract tests: 302 → 590 (3 new adapter test suites × 96 tests)
- Total: 590 tests, 13 suites, 4 backends, 0 failures
5 Tool/Memory nodes for Agent-to-Agent communication.
Zero modification to existing code, 590 tests, 4 storage backends.
- CHATFLOW_MVP_ALLOWLIST: +5 entries (a2aRegistry, a2aTask, a2aArtifact, a2aSharedContext, a2aMemoryAdapter)
- _version.json chatflowTemplates: +5 A2A entries
Replace in-memory Map with Node.js fs persistence:
- JSON file per table (8 tables + context)
- Configurable dataDir via config.dataDir (default: ./.a2a-data)
- File naming: {dataDir}/{tableName}.json
- Implement all CRUD methods with readTable/writeTable helpers

Update all test consumers to use temp directories for isolation:
- LocalJsonAdapter.test.ts: add file persistence tests
- A2ATask, A2AArtifact, A2ASharedContext, integration tests
- Fix bun compatibility: remove resolves.not.toThrow() pattern
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive framework for managing AI agents and flows in Flowise, featuring strict Zod-based validation schemas, model and credential registries, and an automated assembly and testing pipeline. It also includes detailed architectural documentation and templates for the a2a-lab simulation system, covering technical evaluation, citizen perception, and communication strategy flows. I have no feedback to provide.

Replace in-memory Map storage with real SQLite database via better-sqlite3:
- Enable better-sqlite3 dependency and type definitions
- Add JSON serialize/deserialize helpers for array/object columns
- Execute full DDL on initialization (idempotent)
- Implement all CRUD operations with parameterized queries
- Add a2a_context table for saveContext/loadContext
- Default dbPath: ./.a2a-data/a2a.db
- Update tests to use :memory: database with adapter-specific coverage
…olumns

Replace in-memory Map with real PostgreSQL via pg library:
- Connection via config.connectionString or PG* env vars
- Connection pooling (Pool from pg)
- DDL with JSONB for arrays/objects (capabilities, metadata, etc.)
- Parameterized queries for all CRUD operations
- ON CONFLICT upsert for context storage
- updateTaskStatus supports optional metadata merge

Tests mock pg module to run contract suite without real DB.
…base-js client

Replace the in-memory Map stub with a real Supabase client using
@supabase/supabase-js. The adapter now performs actual CRUD operations
against Supabase PostgreSQL via the REST API.

Key changes:
- Enable the previously commented import of createClient/SupabaseClient
- Constructor reads config.supabaseProjUrl / config.supabaseApiKey or
  falls back to SUPABASE_URL / SUPABASE_API_KEY env vars
- All methods use client.from(table).insert/select/update/delete/upsert
- JSON/JSONB fields passed as plain objects (Supabase serializes)
- Snake_case column names aligned with Postgres conventions
- updateTaskStatus signature fixed to include optional metadata param
- Defensive cloning of permissions objects in grantAccess/revokeAccess
  to avoid mutating deserialized JSONB references

Tests:
- Mock @supabase/supabase-js with in-memory query builder
- Contract tests pass (103/103)
- Adapter-specific tests for config validation, isolation, idempotency,
  metadata updates, permissions, and message ordering

Refs: PR 4 — a2a-storage-real-adapters
@leomerida15 leomerida15 force-pushed the a2a-storage-real-adapters branch from fa69595 to aec24f3 Compare May 7, 2026 20:28
feat(a2a): implement real LocalJsonAdapter with file-based JSON storage
feat(a2a): implement real PostgresAdapter with pg Pool
feat(a2a): implement real SupabaseAdapter with @supabase/supabase-js
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.

fix(docker): Railway build timeout due to recursive chown in Dockerfile

3 participants