Commit Graph

748 Commits

Author SHA1 Message Date
molecule-ai[bot]
40a8e41808
Merge pull request #635 from Molecule-AI/chore/eco-watch-2026-04-17-clean
Merge gate passed. Docs-only — ecosystem-watch.md entries only, no code/schema/auth. UNSTABLE = known App token scope gap.
2026-04-17 06:21:03 +00:00
Molecule AI Backend Engineer
fce0be30fd fix(#611): remove budget_limit from PATCH /workspaces/:id and strip financial fields from GET
Security Auditor findings on PR #611:

Fix 1 (BLOCKING): Remove budget_limit handling from Update() entirely.
PATCH /workspaces/:id uses ValidateAnyToken — any enrolled workspace bearer
could self-clear its own spending ceiling. The dedicated AdminAuth-gated
PATCH /workspaces/:id/budget is the only authorised write path.

Fix 2 (MEDIUM): Strip budget_limit and monthly_spend from Get() response
before c.JSON(). GET /workspaces/:id is on the open router — any caller
with a valid UUID must not read billing data.

Also updates four existing tests in workspace_budget_test.go that encoded
the old (insecure) behaviour, and adds three new regression tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:18:41 +00:00
Molecule AI Backend Engineer
dd0b282c79 fix(issue-541): move PATCH /budget to adminAuth — workspace must not self-clear ceiling
Workspace agents could previously call PATCH /workspaces/:id/budget with their
own bearer token and set budget_limit=null, defeating the entire spend enforcement
feature. GET stays on wsAuth (reading own budget is legitimate); PATCH moves to
inline AdminAuth using the same pattern as /approvals/pending.

No existing tests needed updating — all budget PATCH tests call the handler
directly and are unaffected by router-level middleware changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:18:41 +00:00
Molecule AI Backend Engineer
4e6e3745f2 fix(issue-541): correct stale 429 comment to 402 in checkWorkspaceBudget
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:18:41 +00:00
Molecule AI Backend Engineer
2fb0aacd41 fix(#541): change budget enforcement status from 429 to 402
Budget limit exceeded on A2A proxy now returns HTTP 402 PaymentRequired
instead of 429 TooManyRequests, matching the issue spec and the FE amber
banner check. Updates a2a_proxy.go, workspace_budget_test.go (renamed
ExceededReturns429 → ExceededReturns402, AboveLimitReturns429 →
AboveLimitReturns402), and migration comment. All go test ./... pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:18:41 +00:00
Molecule AI Backend Engineer
22af070ef3 feat(#541): add dedicated GET/PATCH /workspaces/:id/budget endpoints
- New BudgetHandler with GetBudget and PatchBudget methods
- GET returns budget_limit (null or int64 USD cents), monthly_spend,
  and computed budget_remaining (null when no limit, can be negative
  when over-budget so callers can see the magnitude of the overage)
- PATCH accepts {budget_limit: int64|null}; null clears the ceiling;
  validates non-negative values; re-reads DB to echo final state
- Both handlers are wired in router.go under the WorkspaceAuth group
- 14 unit tests covering happy paths, 404, 400 validation, DB errors,
  over-budget state, zero limit, and clear-limit round-trip
- All 20 packages pass go test ./... and go build ./... is clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:18:41 +00:00
Molecule AI Backend Engineer
f8106b35be feat(platform): add per-workspace budget_limit field and A2A enforcement (#541)
- Migration 025: ADD COLUMN budget_limit BIGINT DEFAULT NULL and
  monthly_spend BIGINT NOT NULL DEFAULT 0 to workspaces table
- Models: BudgetLimit *int64 in CreateWorkspacePayload;
  MonthlySpend int64 in HeartbeatPayload
- workspace.go: scanWorkspaceRow, workspaceListQuery, Get, Create, and
  Update all handle budget_limit/monthly_spend; budget_limit is gated
  as a sensitiveUpdateField
- registry.go: heartbeat conditionally writes monthly_spend only when
  payload.MonthlySpend > 0 (avoids overwriting with zero)
- a2a_proxy.go: checkWorkspaceBudget() returns 429 when
  monthly_spend >= budget_limit (NULL = no limit; fail-open on DB error)
- Tests: 8 new workspace_budget_test.go tests + patched existing tests
  for the 20-column scanWorkspaceRow and 10-param CREATE INSERT

Field type: BIGINT (int64), units: USD cents (budget_limit=500 = $5.00/month)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:18:41 +00:00
molecule-ai[bot]
5b42bd76b5
Merge pull request #629 from Molecule-AI/fix/issue-614-security-headers
Merge gate passed (all 7 gates). Adds /orgs to apiPrefixes so PR #610's allowlist routes get nosniff + X-Frame-Options headers. One-line fix + 50 lines of regression tests. UNSTABLE = known App token scope gap.
2026-04-17 06:18:25 +00:00
Hongming Wang
44cef47763
Merge pull request #630 from Molecule-AI/fix/issue-615-cap-token-counts
fix(platform): cap token counts before upsert to prevent NUMERIC overflow (#615)
2026-04-16 23:17:37 -07:00
Molecule AI Backend Engineer
3329370b1c fix(migrations): close 024→026 gap — rename 026→025 token_usage, 027→026 allowlist (#631)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:17:36 +00:00
molecule-ai[bot]
9bac2d20f9
Merge pull request #627 from Molecule-AI/feat/issue-592-wire-metrics-api
Merge gate passed (all 7 gates). Conflicts were mechanical: WorkspaceUsage.tsx full implementation over scaffold (backend #593 is live), RevealToggle.tsx 'use client' deduplicated. UNSTABLE = known GitHub App token scope gap.
2026-04-17 06:17:00 +00:00
040f674a6a fix(gate-1): resolve merge conflicts with main
Three add/add + content conflicts, all mechanical:
- WorkspaceUsage.tsx: HEAD (full live-metrics implementation wired
  to GET /workspaces/:id/metrics) over main's scaffold placeholder;
  #593 backend is now live so the TODO is fulfilled
- WorkspaceUsage.test.tsx: HEAD (full mock-api test suite, 10 tests)
  over main's scaffold tests (tested placeholder — values now stale)
- RevealToggle.tsx: both sides independently added 'use client'; kept
  main's double-quote variant ("use client") for codebase consistency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:16:36 +00:00
Molecule AI Backend Engineer
668c93e513 fix(platform): cap monthly_spend on heartbeat upsert (#615)
A malicious or buggy agent could report MonthlySpend = math.MaxInt64
causing NUMERIC overflow in the DB or incorrect budget-enforcement
comparisons downstream.

Changes:
- Add MonthlySpend int64 field to HeartbeatPayload (json:"monthly_spend")
- Clamp negative values to 0 and values above $10B (1_000_000_000_000
  cents) to the cap before any DB write
- The two-path UPDATE: when MonthlySpend > 0 after clamping, include
  monthly_spend = $7 in the UPDATE; otherwise skip to avoid accidentally
  clearing a previously-reported spend value
- 5 regression tests covering: within-bounds passthrough, negative
  clamp, math.MaxInt64 overflow clamp, exact-cap boundary, and
  zero/omitted no-update path

Note: this branch introduces MonthlySpend to HeartbeatPayload; it will
need trivial conflict resolution when feat/issue-541-budget-limit-backend
merges, as that branch also adds the field (without the cap). Keep this
branch's clamping logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:16:06 +00:00
molecule-ai[bot]
398c1e9f68
Merge pull request #628 from Molecule-AI/fix/issue-623-adminauth-origin-bypass
Merge gate passed (all 7 gates). Security fix: removes canvasOriginAllowed + isSameOriginCanvas Origin bypass from AdminAuth — bearer token is now the only accepted credential on admin routes. 3 regression tests cover forged-localhost, forged-tenant-domain, and bearer+Origin golden path. Auth PR — CEO explicit approval confirmed in chat. UNSTABLE = known GitHub App token scope gap.
2026-04-17 06:13:33 +00:00
molecule-ai[bot]
deecd01a8d
Merge pull request #606 from Molecule-AI/feat/issue-541-budget-limit-frontend
Merge gate passed (all 7 gates). All merge conflicts were mechanically additive (BudgetSection + WorkspaceUsage both kept; hydrating spinner + error banner combined; useId import preserved; WCAG a11y tests kept). UNSTABLE = known GitHub App token scope gap, not a test failure.
2026-04-17 06:10:53 +00:00
Molecule AI Frontend Engineer
bfe4e09b7e fix(canvas): move vi.mock to module top level in ZoomShortcut.test (#632)
The vi.mock("../../../store/canvas") call was nested inside an it()
block. Vitest hoists all vi.mock calls to module scope at runtime
regardless, so the code never matched its actual execution order —
prompting the "not at top level" warning that Vitest will make a hard
error in a future version.

Move the mock to after the imports, remove the now-redundant inline
call from the it() body, and add a comment explaining the hoisting rule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:09:39 +00:00
Molecule AI Frontend Engineer
a60ece77c6 fix(canvas): use explicit empty-string check in BudgetSection to preserve zero-credit budget
parseInt("0", 10) || null evaluates to null, silently converting a
zero-credit budget to unlimited. Switch to raw !== "" ? parseInt() : null
so budget_limit: 0 is sent correctly. Adds regression test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:07:08 +00:00
Molecule AI Frontend Engineer
c064200164 fix(canvas): WCAG SC 1.3.1 — programmatic label/input association in InputField
Adds useId() to the InputField helper in CreateWorkspaceDialog so every
<label> is wired to its <input> via htmlFor/id. Without this, screen readers
announced only the placeholder text, not the field name (WCAG 2.1 SC 1.3.1
Level A violation, build 4JIwTGVMjDGNLO8iMGJeC).

Affected fields: Name (required), Role, Budget limit (USD), Template.
The Hermes provider fields were already correctly wired.

Adds 6 new tests in CreateWorkspaceDialog.a11y.test.tsx verifying htmlFor/id
round-trips for each field and unique-id non-collision (602 total, all pass;
build clean; 'use client' grep empty).

Note: #554 (hydration error UI) and #556 (tier radio arrow-key nav) are
confirmed fixed in commit 76defba — audit cycle 2 was run against the
pre-fix build. #557 (zoom-to-team Z key) is a false positive — the handler
IS implemented; closing via Dev Lead once token is refreshed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:07:08 +00:00
Molecule AI Frontend Engineer
2152323cd1 feat(#541): budget settings UI with usage stats and 402 handling
Adds a dedicated BudgetSection component to the workspace details panel:
- GET /workspaces/:id/budget on mount — populates live stats (used/limit/remaining)
- Stats row + blue-500 progress bar (capped at 100%; hidden when unlimited)
- PATCH /workspaces/:id/budget for saving; input blank → budget_limit: null
- "Budget exceeded — messages blocked" amber/zinc-950 banner on any 402 response
  (GET or PATCH); banner clears on a successful subsequent save
- 'use client'; dark zinc theme throughout (zinc-800/700 inputs, blue-500 accents)

DetailsTab refactored: inline budget_limit fields removed; BudgetSection mounted
as a self-contained section between Workspace and Skills. PATCH /workspaces/:id
body no longer includes budget_limit — that concern is isolated to BudgetSection.

Tests: 21 new cases in BudgetSection.test.tsx (loading, stats, progress bar,
save, 402 GET, 402 PATCH, banner clear, non-402 errors). BudgetLimit.DetailsTab
rewritten to mock BudgetSection and verify the DetailsTab/BudgetSection
integration contract (596 total, all pass; build clean; 'use client' grep empty).

API shape: GET/PATCH /workspaces/:id/budget → {budget_limit: int64|null,
budget_used: int64, budget_remaining: int64|null}

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:07:07 +00:00
Molecule AI Frontend Engineer
5d081769e5 feat(canvas): budget_limit input in workspace creation and settings UI (#541)
- Adds optional Budget limit (USD) numeric field to CreateWorkspaceDialog;
  blank = null (unlimited), populated = parsed float sent as budget_limit in
  POST /workspaces body
- Adds budget_limit field to DetailsTab edit form; saves via
  PATCH /workspaces/:id; pre-fills from current WorkspaceNodeData
- Shows 'Budget limit exceeded' warning badge when budgetUsed > budgetLimit
  (forward-compatible — badge hidden when budgetUsed is absent)
- Extends WorkspaceData, WorkspaceNodeData, and buildNodesAndEdges to carry
  budgetLimit / budgetUsed fields ready for backend hydration (issue #541 BE PR)
- Ships 22 new tests across CreateWorkspaceDialog and BudgetLimit.DetailsTab
  suites (575 total, all passing); npm run build clean; 'use client' grep empty

API shape confirmed from workspace.go and CreateWorkspacePayload struct:
  field name: budget_limit | type: number | null | units: USD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:06:36 +00:00
Molecule AI Backend Engineer
13b8965c99 fix(platform): cap token counts before upsert to prevent NUMERIC overflow (#615)
Adversarial or buggy agents can report INT64_MAX token counts via A2A
responses. Without clamping, upsertTokenUsage would pass these directly to
Postgres NUMERIC(12,6), causing a silent upsert failure that corrupts the
workspace's cost accounting.

Fix: clamp input_tokens/output_tokens to [0, 10_000_000] before any
arithmetic or DB write. 10M tokens/call is well above any real LLM API
response; clamped values still produce valid cost rows.

Adds 4 regression tests:
- TestUpsertTokenUsage_615_CapsInt64Max      — INT64_MAX → maxTokensPerCall
- TestUpsertTokenUsage_615_CapsNegative      — negative → 0 (no DB call)
- TestUpsertTokenUsage_615_NormalValuesUnchanged — passthrough for normal counts
- TestUpsertTokenUsage_615_ExactlyAtCap      — at-cap value accepted unchanged

Closes #615

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:03:40 +00:00
Molecule AI Backend Engineer
67a9ec8fcb fix(platform): pin X-Content-Type-Options nosniff + add /orgs API prefix (#614)
SecurityHeaders() middleware already sets X-Content-Type-Options: nosniff and
X-Frame-Options: DENY globally on every response (issue #151 / PR ~securityheaders).
This commit adds the explicit acceptance test that #614 requires and extends
the apiPrefixes list to cover the new /orgs allowlist routes from PR #610.

Changes:
- securityheaders.go: add "/orgs" to apiPrefixes so allowlist routes get the
  strict CSP (no unsafe-inline) rather than the canvas-tier permissive policy
- securityheaders_test.go: TestSecurityHeaders_614_NosniffOnSSEAndAPIEndpoints
  verifies the header is present on SSE endpoint, /settings/secrets, /events,
  and /orgs paths; TestIsAPIPath gains /orgs cases

Closes #614

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:02:18 +00:00
Molecule AI Backend Engineer
cc45f0c0f6 fix(security): remove canvasOriginAllowed from AdminAuth middleware (#623)
The Origin header is trivially forgeable by any container on the Docker
network. Having canvasOriginAllowed() / isSameOriginCanvas() as auth
bypass paths in AdminAuth let any curl/container without a bearer token
reach /settings/secrets, /bundles/import, /bundles/export, /events, and
all other AdminAuth-gated routes by forging Origin: http://localhost:3000.

Fix: remove both Origin bypass branches from AdminAuth. Bearer token is
now the only accepted credential. Lazy-bootstrap fail-open (zero tokens →
pass-through) is preserved for fresh installs.

CanvasOrBearer retains the Origin bypass because it is scoped exclusively
to cosmetic routes (PUT /canvas/viewport) where a forged request has zero
security impact — worst case is viewport position corruption.

Added 3 regression tests:
- TestAdminAuth_623_ForgedOrigin_Returns401
- TestAdminAuth_623_ForgedCORSOrigin_Returns401
- TestAdminAuth_623_ValidBearer_WithOrigin_Passes

Closes #623, Closes #626

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:00:45 +00:00
Molecule AI Frontend Engineer
e89d9a1239 feat(canvas): wire live metrics API in WorkspaceUsage (#592)
WorkspaceUsage now fetches GET /workspaces/:id/metrics on mount and on
workspaceId change. Displays input_tokens and output_tokens formatted
with toLocaleString, and estimated_cost_usd as $X.XXXXXX. Shows three
zinc-700 skeleton rows while loading; surfaces error text on failure.
Stale-fetch guard via ignore flag prevents state updates after unmount.

Also fixes missing 'use client' in RevealToggle.tsx (#603) — the
onClick handler requires client-side hydration.

Tests updated: 12 tests covering loading skeleton, API call correctness,
token formatting, cost formatting, error state, and workspaceId refetch.
All 551 canvas tests pass; build clean.

Closes #592
Closes #603

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:00:14 +00:00
molecule-ai[bot]
b948f0b140
Merge pull request #610 from Molecule-AI/feat/issue-591-org-plugin-allowlist
feat(platform): per-org plugin governance registry (allowlist)
2026-04-17 05:55:27 +00:00
molecule-ai[bot]
9f815e27a1
Merge pull request #602 from Molecule-AI/feat/issue-593-workspace-token-tracking
feat(platform): per-workspace token tracking + GET /workspaces/:id/metrics
2026-04-17 05:54:27 +00:00
molecule-ai[bot]
588190a92f
Merge pull request #612 from Molecule-AI/fix/test-token-adminauth
fix(security): gate test-token endpoint behind AdminAuth
2026-04-17 05:53:49 +00:00
molecule-ai[bot]
3ecdcf8c6b
Merge pull request #601 from Molecule-AI/feat/issue-590-agui-sse-endpoint
feat(platform): AG-UI compatible SSE endpoint for streaming agent events
2026-04-17 05:45:29 +00:00
Molecule AI Backend Engineer
53284c4626 feat(platform): per-org plugin governance registry (#591)
Add an org-scoped allowlist table so org admins can restrict which plugins
workspace agents are allowed to install.  An empty allowlist means
allow-all (backward-compatible with existing deployments).

• migrations/027_org_plugin_allowlist.{up,down}.sql — new table + unique
  index on (org_id, plugin_name)
• handlers/org_plugin_allowlist.go — resolveOrgID, checkOrgPluginAllowlist
  (fail-open on DB errors), GetAllowlist, PutAllowlist (atomic tx replace)
• handlers/org_plugin_allowlist_test.go — 23 unit tests covering all
  handler paths, resolveOrgID, and all checkOrgPluginAllowlist branches
• handlers/plugins_install.go — allowlist gate between resolveAndStage and
  deliverToContainer; returns 403 if plugin is blocked
• router/router.go — GET/PUT /orgs/:id/plugins/allowlist under AdminAuth

All tests pass; go build ./... clean; gosec Issues: 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 05:40:23 +00:00
molecule-ai[bot]
ff756a3920
Merge pull request #600 from Molecule-AI/feat/issue-592-workspace-cost-transparency
feat(canvas): scaffold WorkspaceUsage component for #592
2026-04-17 05:32:40 +00:00
Molecule AI Backend Engineer
f60c9df26f feat(platform): per-workspace token tracking + GET /workspaces/:id/metrics (#593)
Migration 026 adds workspace_token_usage table (uuid pk, workspace_id FK with
CASCADE, period_start TIMESTAMPTZ, input_tokens, output_tokens, call_count,
estimated_cost_usd NUMERIC(12,6), updated_at) with a UNIQUE index on
(workspace_id, period_start) for day-granularity upserts.

A2A proxy (proxyA2ARequest) now spawns a detached goroutine after each
successful call to extractAndUpsertTokenUsage, which:
  1. Parses usage.input_tokens / usage.output_tokens from result.usage
     (JSON-RPC wrapper) with fallback to top-level usage (direct Anthropic).
  2. Calls upsertTokenUsage — INSERT ... ON CONFLICT DO UPDATE so multi-
     call days accumulate correctly. Estimated cost = input×$0.000003 +
     output×$0.000015 (Claude Sonnet default; adjustable in a later phase).
  Token tracking never blocks the critical A2A path.

New endpoint: GET /workspaces/:id/metrics (wsAuth — WorkspaceAuth bearer
bound to :id). Returns:
  {"input_tokens":N,"output_tokens":N,"total_calls":N,
   "estimated_cost_usd":"0.000000","period_start":"...","period_end":"..."}
404 if workspace missing. Period is current UTC day.

11 new tests (4 handler + 7 parse-unit); 19/19 packages pass.

Closes #593

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 05:29:10 +00:00
molecule-ai[bot]
2e67163467
Merge pull request #597 from Molecule-AI/fix/issue-566-deep-merge-hooks-dedup
fix(plugins_registry): deduplicate handlers in _deep_merge_hooks() — closes #566
2026-04-17 05:28:49 +00:00
4eb56ebec6 fix(plugins_registry): deduplicate handlers in _deep_merge_hooks()
Unconditional list.extend() on repeated plugin install caused every
hook handler to be appended on each reinstall, leading to 3-4x duplicate
firings per event (PreToolUse, PostToolUse, Stop, etc.).

Fix: before appending each incoming handler, compute a fingerprint of
(matcher, frozenset-of-commands). Skip append if the fingerprint is
already present in the merged list. First-time installs are unaffected —
new handlers still land correctly.

Adds 7 unit tests covering: first install, double install, triple install,
different-matcher co-existence, different-command co-existence, existing
user hook preservation, and top-level key merge semantics.

Closes #566

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 05:22:00 +00:00
Molecule AI Research Lead
31da53bf5b chore(eco-watch): 2026-04-17 daily survey — OpenAI Codex Agent, Qwen3.6, EvoMap Evolver
Three new entries from today's survey (MA + TR + CI parallel scan):

- OpenAI Codex Agent [HIGH] — relaunched Apr 17 as full autonomous agent
  product: parallel subagents, cross-session memory, self-wake scheduling,
  macOS computer control. Distinct threat from openai-agents-sdk. Direct
  overlap with workspace lifecycle + agent_memories + workspace_schedules.

- Qwen3.6-35B-A3B [MEDIUM] — open-weight MoE model (35B/3B active) for
  agentic coding; HN #1 story today (984 pts); commoditizes model layer for
  self-hosted orchestrators; erodes cost moat for cloud-locked competitors.

- EvoMap Evolver [LOW] — A2A-native GEP self-evolution engine; worker nodes
  use A2A_HUB_URL protocol compatible with our A2A stack; SKILL.md + Skill
  Store align with agentskills.io; EvolutionEvent JSONL audit ledger is
  reference design for governance canvas (#582). Integration opportunity.

GH issues filed:
- #594: molecule-audit-ledger (HMAC-SHA256, ~7 dev-days, SOC2/EU AI Act)
- #595: Cloudflare Artifacts demo before May public beta (2-week window)
- #596: add Molecule AI as compound-engineering-plugin target (2-4h upstream PR)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 05:18:11 +00:00
Molecule AI Frontend Engineer
a6a559d62c feat(canvas): scaffold WorkspaceUsage component for #592
Adds WorkspaceUsage component to canvas/src/components/ with three
placeholder stat rows (Input tokens, Output tokens, Estimated cost)
and a "pending #593" badge. Wires into DetailsTab between the Workspace
and Skills sections. No API calls yet — fetch logic will be added once
GET /workspaces/:id/metrics lands in #593.

9 tests in WorkspaceUsage.test.tsx; all 548 canvas tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 05:16:57 +00:00
Molecule AI Backend Engineer
c2891b5aba feat(platform): AG-UI compatible SSE endpoint for streaming agent events (#590)
- Add in-process SSE subscription mechanism to Broadcaster (SubscribeSSE,
  deliverToSSE) so both RecordAndBroadcast *and* BroadcastOnly fan out to
  SSE subscribers — critical because BroadcastOnly skips Redis pub/sub and
  would be invisible to a Redis-only subscriber (AGENT_MESSAGE, A2A_RESPONSE,
  TASK_UPDATED are all BroadcastOnly events).
- Add handlers/sse.go: SSEHandler.StreamEvents sets text/event-stream headers,
  checks workspace existence (404 if missing), subscribes via broadcaster, and
  wraps each WSMessage in an AG-UI envelope:
    data: {"type":"<event>","timestamp":<unix_ms>,"data":{...}}\n\n
- Register wsAuth.GET("/workspaces/:id/events/stream") behind existing
  WorkspaceAuth middleware — bearer token bound to :id.
- Add 6 tests: Content-Type, initial ping, AG-UI format, workspace filter
  (cross-workspace events not leaked), 404 on missing workspace, multiple
  sequential events.

All 19 packages pass. Build clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 05:16:51 +00:00
Hongming Wang
b9dbfda68b
Merge pull request #589 from Molecule-AI/docs/ecosystem-maf-v1
docs(ecosystem): update MAF with v1.0 GA + AG-UI competitive findings
2026-04-16 22:06:42 -07:00
Hongming Wang
87b9015a10
Merge pull request #588 from Molecule-AI/fix/hermes-preflight-keys
fix(canvas): add hermes + gemini-cli to deploy preflight required keys
2026-04-16 22:06:28 -07:00
Hongming Wang
713382c77e docs(ecosystem): update MAF entry with v1.0 GA + AG-UI findings
MAF v1.0 shipped April 7 with multi-agent orchestration, native A2A+MCP,
AG-UI SSE protocol for streaming events to frontends. AG-UI is a direct
competitor to our WebSocket canvas. Added actionable gaps: AG-UI endpoint,
tool governance registry, cost transparency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:53:49 -07:00
Hongming Wang
0e55e97cc3 fix(canvas): add hermes + gemini-cli to deploy preflight required keys
Hermes requires OPENROUTER_API_KEY (or any of its 15 providers).
Gemini CLI requires GOOGLE_API_KEY. Without these entries, the
MissingKeysModal doesn't fire and workspaces start without keys,
causing crash loops.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:45:54 -07:00
Hongming Wang
3520f0f983
Merge pull request #587 from Molecule-AI/fix/canvas-ux-polish
fix(canvas): 5 UX polish fixes — error handling, a11y, loading state
2026-04-16 21:44:29 -07:00
Hongming Wang
c06ac8aa8a fix(canvas): 5 UX polish fixes — error handling, a11y, loading state
1. ScheduleTab + ChannelsTab: wrap toggle/delete in try/catch with
   error feedback (was silently swallowing API failures)
2. MemoryTab: "+Add" button now auto-expands Advanced section
3. SidePanel: keyboard-navigated tabs scroll into view
4. TracesTab: emoji aria-hidden, env-var hint in <details>
5. page.tsx: show Spinner while hydrating instead of flash of EmptyState

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:39:44 -07:00
Hongming Wang
1af06a669b
Merge pull request #586 from Molecule-AI/fix/remove-brand-monitor
chore: remove brand-monitor from monorepo
2026-04-16 21:01:12 -07:00
Hongming Wang
ee677b8c63 chore: remove brand-monitor from monorepo
Standalone operational tool — doesn't belong in the platform core.
Should live in its own repo if needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:00:58 -07:00
Molecule AI Research Lead
a6510e3d45 chore(eco-watch): 2026-04-17 daily survey — dimos, Cloudflare Workers AI
Two new LOW-tier entries:
- dimos (dimensionalOS/dimos, 2.9k, v0.0.11, MIT) — agentic OS for
  robotics; MCP as primary agent interface; module/blueprint architecture
  with typed stream passing; spatio-temporal RAG memory; hardware:
  Unitree/AgileX/DJI/MAVLink. Watch for A2A support.
- Cloudflare Workers AI (Agents Week 2026) — unified inference layer:
  70+ models, 14+ providers, auto-failover, streaming resilience, 330
  global PoPs. Part of Cloudflare full-stack agent platform (+ Durable
  Objects + Artifacts + Agents SDK + AI Search). Separate from previously
  tracked Cloudflare Artifacts entry. Escalate to MEDIUM if Agents SDK
  integrates all four primitives into one-click multi-agent deployment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 02:55:34 +00:00
Molecule AI Backend Engineer
3e1e68004d fix(security): add AdminAuth to /admin/workspaces/:id/test-token route
Without middleware, any caller on a non-production instance could mint a
bearer token for any workspace UUID with no authentication. AdminAuth is
defence-in-depth: on a fresh install (no tokens yet) it is fail-open so
the bootstrap path still works; once the first workspace enrolls a token
all callers must present a valid bearer.

Adds two router-level tests confirming the gate:
- TestTestTokenRoute_RequiresAdminAuth_WhenTokensExist → 401 with no header
- TestTestTokenRoute_FailOpenOnFreshInstall → 200 (bootstrap path intact)

Env-var gating inside GetTestToken is retained as a second layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 02:48:00 +00:00
Molecule AI Research Lead
e584ebe5ee docs(eco-watch): enrich Compound Engineering Plugin entry with CI analysis
- Correct mechanism: .claude-plugin/ is canonical source (already our format)
- Document actual 11 current targets; molecule-ai NOT present
- Add ~2-4h upstream PR estimate to add molecule-ai.ts target
- Note time-sensitivity: file PR before Cursor (12th) slot lands
- Clarify threat-vs-opportunity: pure opportunity (our format already matches)
- Add action item and signals to watch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 02:25:41 +00:00
Molecule AI Research Lead
e6feb4bd0a fix(eco-watch): correct CrewAI A2A spec version — v0.3.0, not v0.8/v0.9
TR research (2026-04-17) confirmed v0.8/v0.9 do not exist in the A2A spec
history. Both Molecule AI (a2a-sdk==0.3.25) and CrewAI (protocol_version
default "0.3.0") are on spec v0.3.0 — zero-shim interop confirmed today.

Real future risk: A2A v1.0.0 (Mar 12 2026) — breaking changes in wire
format, agent card schema, OAuth flow. Neither side has migrated; shared
upgrade clock. Schedule coordinated migration before either upgrades.

Updates:
- YAML notable_changes: replace "v0.8/v0.9" with "v0.3.0, matches
  a2a-sdk==0.3.25, zero-shim interop confirmed, v1.0.0 shared clock"
- Narrative: add A2A interop confirmed section + updated signals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 02:23:23 +00:00
Molecule AI Research Lead
18f71f5f11 chore(eco-watch): 2026-04-17 daily survey — Compound plugin, EDDI, Cloudflare Artifacts
Adds 3 entries from daily GitHub trending + HN sweep:

- Compound Engineering Plugin (EveryInc, 14.5k, MIT, v2.66.1 Apr 16)
  Multi-runtime plugin converter: one source → 12 runtimes simultaneously
  (Claude Code, Cursor, OpenClaw, Codex, Gemini CLI, Kiro, Windsurf, etc.)
  Competes with our agentskills.io multi-runtime adapter distribution pattern.

- EDDI (labsai, 296, Apache 2.0, v6.0.1, Show HN Apr 17)
  Config-driven multi-agent orchestration; A2A + cron + Ed25519 agent identity
  + HMAC-SHA256 immutable audit ledger + GDPR/HIPAA; reference for compliance-
  guardrails audit trail design (#staged-issue-C).

- Cloudflare Artifacts (private beta Apr 16, infrastructure watch)
  Git-for-agents versioned workspace storage on Durable Objects; ArtifactFS
  driver OSS; escalation trigger: Cloudflare Agents SDK integration.

Also skipped: dimos (robotics, proprietary CLA), 40 non-agent trending repos.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 02:15:47 +00:00
Hongming Wang
28f720ea22
Merge pull request #564 from Molecule-AI/feat/issue-549-x-brand-monitor
feat(brand-monitor): X API pay-per-use brand monitor with surge mode → Slack
2026-04-16 19:15:12 -07:00