Commit Graph

5256 Commits

Author SHA1 Message Date
fe21795dcc test(canvas): add TracesTab tests (36 cases)
Cover loading/error/empty states, trace list rendering, expand/collapse
with aria-expanded/aria-controls, status dot colors (bg-bad/bg-good),
latency formatting (ms vs seconds), token count, cost display,
input/output rendering (object and string), refresh, and formatTime
relative timestamps.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
369360bc99 test(canvas): add ScheduleTab tests (49 cases)
Add 49 test cases covering schedule list, status dot colors,
toggle/edit/delete/run-now, create/edit forms, form validation,
auto-refresh (10s interval), cronToHuman/relativeTime formatting,
and error states.

Also fix ScheduleTab: (1) set error state on GET failure so the
banner is visible, (2) move error banner outside the form block so
non-form errors are shown to the user.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
8c61a1acba test(canvas): add ChannelsTab tests (40 cases)
Cover channel list, toggle, delete, discover, form validation,
schema-driven inputs (password/textarea/text), platform switching,
allowed_users, auto-refresh, and error states.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
a58fa26f28 chore: retrigger CI after rebase to main 2026-05-11 17:20:41 +00:00
1f895ced2b test(canvas): add EventsTab tests (18 cases)
Covers: loading/empty/event-list states, event_type color mapping,
expand/collapse with aria-expanded/aria-controls, refresh button,
error state from API rejection, auto-refresh interval via setInterval mock,
and unmount cleanup.

Key patterns:
- vi.hoisted() for module-level api mock (vi.mock hoisting)
- vi.useRealTimers() for non-timing tests; spyOn(setInterval/clearInterval)
  for auto-refresh tests to avoid Vitest fake-timer infinite loops
- fireEvent.click + native .click() via act() for expand/collapse
- Re-query DOM after state flush to avoid stale element references

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
dbc11023b7 test(ExternalConnectModal): 18 cases — modal render, tabs, token stamping, copy
Adds first test coverage for canvas/ExternalConnectModal. Tests: renders null
when info absent, dialog open/close, default tab selection (Universal MCP vs
Python), tab switching and visibility (Hermes/Codex conditional), auth token
stamping for Python/MCP/curl snippets, clipboard.writeText API call,
close button callback, security warning, Fields tab with (missing) fallback.

Radix Dialog tested by rendering with open=true. Clipboard API mocked via
Object.defineProperty in beforeEach. renderAndFlush uses act(()=>{}) to
synchronously flush Radix portal rendering so dialog queries work without
waitFor (which times out under vi.useFakeTimers).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
7064f6d9f2 Merge pull request 'fix(a2a): add cache-first check to enrich_peer_metadata_nonblocking' (#518) from sre/fix-enrich-nonblocking-cache-check into main 2026-05-11 17:11:35 +00:00
1380bf0907 fix(a2a): add cache-first check to enrich_peer_metadata_nonblocking
enrich_peer_metadata_nonblocking (a2a_client.py) never checked the
_peer_metadata cache before scheduling a background fetch — it always
returned None and always fired the executor thread pool. The docstring
promised "cache hit: return the cached record" but the code did not
implement it.

Fix: add the same TTL-check that enrich_peer_metadata uses before
scheduling the worker. On a warm cache hit the function now returns
immediately without touching the in-flight set or the executor.

Closes the remaining 5 test failures in test_a2a_mcp_server.py on main
that were not covered by PR #508's test-assertions fix.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 16:59:54 +00:00
fc1b15b46a Merge pull request 'fix(workspace): update test_delegation_sync_via_polling assertions for OFFSEC-003 (PR #477)' (#508) from sre/fix-test-delegation-sync-polling-assertions into main 2026-05-11 16:37:38 +00:00
ec20cd04ba fix(workspace): update 3 test assertions for OFFSEC-003 boundary wrapping (PR #477)
PR #477 added _A2A_BOUNDARY_START/END wrapping to tool_delegate_task's
success path. Three tests in test_delegation_sync_via_polling.py were
still asserting exact raw strings and broke:

  test_flag_off_uses_send_a2a_message_not_polling
  test_queued_sentinel_triggers_polling_fallback
  test_non_queued_send_result_does_not_trigger_fallback

Fix: check for boundary markers + inner content instead of exact match.
Import _A2A_BOUNDARY_START/END from _sanitize_a2a in the affected
test methods.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 16:29:31 +00:00
c9dfb70314 Merge pull request 'chore(workspace): remove unused imports and f-string prefixes' (#506) from ci/lint-fixes into main 2026-05-11 16:12:32 +00:00
40ca44aa4d chore(workspace): remove unused imports and f-string prefixes
- test_a2a_tools_delegation.py: remove unused `import os`
- test_a2a_tools_impl.py: remove unused `import sys` and `import pytest`
- test_a2a_sanitization.py: remove unused `import pytest` and fix
  two f-strings with no placeholders (extra `f` prefix)

All 27 related tests still pass.
2026-05-11 16:10:17 +00:00
92f3a17a17 test(workspace): add 17-case coverage for enrich_peer_metadata + nonblocking + worker (#502)
Co-authored-by: Molecule AI · core-be <core-be@agents.moleculesai.app>
Co-committed-by: Molecule AI · core-be <core-be@agents.moleculesai.app>
2026-05-11 15:56:25 +00:00
7b783aa2ed fix(workspace): poll activity_logs for a2a_proxy delegation results (closes #354) (#501)
Co-authored-by: Molecule AI · core-be <core-be@agents.moleculesai.app>
Co-committed-by: Molecule AI · core-be <core-be@agents.moleculesai.app>
2026-05-11 15:53:05 +00:00
9025e86cc7 fix(harness-replays): use github.event.commits for push event detect-changes (#499)
Co-authored-by: Molecule AI Core-DevOps <core-devops@agents.moleculesai.app>
Co-committed-by: Molecule AI Core-DevOps <core-devops@agents.moleculesai.app>
2026-05-11 15:49:48 +00:00
952bfb3ca2 fix(workspace): replace asyncio.get_event_loop().run_until_complete with asyncio.run() (#307) (#498)
Co-authored-by: core-be <core-be@agents.moleculesai.app>
Co-committed-by: core-be <core-be@agents.moleculesai.app>
2026-05-11 15:37:34 +00:00
82083fbad9 fix(harness-replays): correct BASE/HEAD for push events in Compare API call (#497)
Co-authored-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
Co-committed-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
2026-05-11 15:32:08 +00:00
3a28330f9c Merge pull request 'fix: TestPollingPathSanitization regression (3 bugs, closes #495)' (#496) from sre/fix-test-polling-sanitization into main 2026-05-11 15:29:25 +00:00
3d73fb1a72 Merge branch 'main' into sre/fix-test-polling-sanitization 2026-05-11 15:28:34 +00:00
ca5831b81e fix(harness-replays): use Gitea Compare API instead of git diff for detect-changes (#476)
Co-authored-by: Molecule AI Core-DevOps <core-devops@agents.moleculesai.app>
Co-committed-by: Molecule AI Core-DevOps <core-devops@agents.moleculesai.app>
2026-05-11 15:26:11 +00:00
d7de4afad4 fix: TestPollingPathSanitization regression — 3 bugs, correct assertions
Three bugs introduced in PR #477:
1. fake_discover(ws_id) missing source_workspace_id kwarg — discover_peer
   signature is (target_id, source_workspace_id=None).
2. Direct attribute assignment (d._delegate_sync_via_polling = ...)
   does not replace module-level 'from module import name' bindings
   resolved at call time; must use monkeypatch.setattr.
3. Assertions checked for [A2A_RESULT_FROM_PEER] but the polling path
   uses _A2A_BOUNDARY_START/END — _A2A_RESULT_FROM_PEER is added by
   send_a2a_message (messaging path), not by _delegate_sync_via_polling.

Additionally: monkeypatch.setenv("DELEGATION_SYNC_VIA_INBOX", "1") forces
the polling code path so the test exercises the correct logic regardless
of environment defaults.

Closes #495.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 15:22:16 +00:00
c4dcfbb089 fix(workspace): default PLATFORM_URL to host.docker.internal in all modules (#475)
Co-authored-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
Co-committed-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
2026-05-11 15:17:53 +00:00
635a42745a fix(workspace): OFFSEC-003 — separate sanitize vs. wrap, fix tool_delegate_task (#477)
Co-authored-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
Co-committed-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
2026-05-11 15:10:25 +00:00
a5d4bea96b test(canvas): add MemoryTab tests (36 cases) (#493)
Co-authored-by: hongming-pc2 <hongming-pc2@moleculesai.app>
Co-committed-by: hongming-pc2 <hongming-pc2@moleculesai.app>
2026-05-11 15:03:08 +00:00
f99b0fdf94 test(OrgCancelButton): 17 test cases for cancel-deployment pill (#485)
Co-authored-by: hongming-pc2 <hongming-pc2@moleculesai.app>
Co-committed-by: hongming-pc2 <hongming-pc2@moleculesai.app>
2026-05-11 14:44:12 +00:00
8019481452 fix(ci): reconcile sweep workflow secrets — use confirmed-existing names (#482)
Co-authored-by: Molecule AI Core-DevOps <core-devops@agents.moleculesai.app>
Co-committed-by: Molecule AI Core-DevOps <core-devops@agents.moleculesai.app>
2026-05-11 14:07:53 +00:00
9ca86bee85 fix(canvas/test): consistent fake-timer state — fix ApprovalBanner test flakiness (#479)
Co-authored-by: Molecule AI App-FE <app-fe@agents.moleculesai.app>
Co-committed-by: Molecule AI App-FE <app-fe@agents.moleculesai.app>
2026-05-11 14:04:04 +00:00
7a731f6b42 fix(runbooks): correct Gitea runner fetch timing facts (post-#457) (#478)
Co-authored-by: Molecule AI Infra-SRE <infra-sre@agents.moleculesai.app>
Co-committed-by: Molecule AI Infra-SRE <infra-sre@agents.moleculesai.app>
2026-05-11 13:45:42 +00:00
6403c5196f Merge pull request 'tools: gate-check-v3 MVP — automated SOP-6 + CI gate detector' (#393) from tools/gate-check-v3 into main 2026-05-11 13:41:08 +00:00
b57cebf8d4 fix(gate-check-v3): tier-aware gate verdict computation
tier:low and tier:high are OR gates — any one positive verdict
is sufficient. The previous implementation required ALL groups to have
positive verdicts, causing INCOMPLETE even when core-devops APPROVED
and core-lead was absent.

Now uses tier-specific logic:
- tier:low / tier:high (OR): any positive = CLEAR
- tier:medium (AND): all positive = CLEAR

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:38:02 +00:00
15e2d93989 fix(gate-check-v3): add pagination to api_list for comment/review scans
Paginate all list endpoints (comments, reviews) to handle PRs with
many comments without missing entries. Uses per_page=100 with page
increment loop, safety-capped at 20 pages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:38:02 +00:00
3eb06e40e6 fix(gate-check-v3): use submitted_at for review timestamps
Gitea reviews use "submitted_at" not "created_at" for when the review
was submitted. The earlier signal_1_comment_scan fix (inherited from
sop-tier-check investigation) already handled this; signal_2 and
signal_3 were missing the same correction.

Fixes KeyError: 'created_at' on PRs with no comments/reviews.
Includes the individual-check-status fix (use "status" not "state").

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:38:02 +00:00
9d05335b1a fix(gate-check-v3): use correct API field for individual check status
Gitea Actions API uses "status" (pending/success/failure) not "state"
for individual status entries. The "state" field is null for pending
runs. This caused all_check_statuses to show Python null instead of
"pending" for queued jobs.

Also verified on PR #391 and PR #393 — individual checks now correctly
display "pending" while combined_state is "pending" (CI_PENDING verdict).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:38:02 +00:00
f470f589c0 tools/gate-check-v3: MVP automated PR gate detector
SOP-6 + CI gate checker for Gitea PRs. Detects:
- Signal 1: Author-aware agent-tag comment scan (tier-aware)
- Signal 2: REQUEST_CHANGES reviews state machine
- Signal 3: Staleness detection (SOP-12)
- Signal 6: CI required-checks awareness

Post `[gate-check-v3] STATUS:` comment on PRs. CLI + Gitea Actions
workflow (cron hourly + PR-triggered).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:38:02 +00:00
0a2e1e9a97 Merge pull request 'fix(canvas/test): replace fixed-delay dialog wait with waitFor polling' (#453) from fix/canvas-purchase-success-modal-test-timing into main 2026-05-11 13:31:59 +00:00
d7e163d2a8 Merge branch 'main' into fix/canvas-purchase-success-modal-test-timing 2026-05-11 13:27:38 +00:00
05e6443e2c test(canvas): add WorkspaceNode component test coverage (51 cases) (#480)
Co-authored-by: Molecule AI Core-FE <core-fe@agents.moleculesai.app>
Co-committed-by: Molecule AI Core-FE <core-fe@agents.moleculesai.app>
2026-05-11 13:14:19 +00:00
b62b18b523 [core-be-agent] ci: retrigger Canvas tests for env validation
Retry CI run to confirm Canvas test suite passes on current head.
2026-05-11 12:50:57 +00:00
e70955298b Merge pull request 'docs(runbooks): add Gitea Actions operational quirks reference' (#457) from docs/gitea-operational-quirks-runbook into main 2026-05-11 12:37:37 +00:00
db647de1cd Merge branch 'main' into docs/gitea-operational-quirks-runbook 2026-05-11 12:35:58 +00:00
94b08ef0de docs(runbooks): add Gitea Actions operational quirks reference
Documents four persistent operational findings from the 2026-05-11
Gitea migration and CI noise investigation:

1. Runner network isolation (git remote unreachable from container)
2. continue-on-error only works at step level, not job level
3. workflow_dispatch.inputs not supported
4. fetch-depth:0 on actions/checkout times out

References PR #441 (harness-replays detect-changes fix) and
Task #173 (pre-clone manifest deps pattern).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 12:25:54 +00:00
1a2cfb9417 test(canvas): add Toolbar component test coverage (19 cases) (#472)
Co-authored-by: Molecule AI Core-FE <core-fe@agents.moleculesai.app>
Co-committed-by: Molecule AI Core-FE <core-fe@agents.moleculesai.app>
2026-05-11 12:25:46 +00:00
3d572d97a3 fix(canvas/test): use string keys in TIER_CONFIG toHaveProperty calls (#440)
Co-authored-by: Molecule AI App-FE <app-fe@agents.moleculesai.app>
Co-committed-by: Molecule AI App-FE <app-fe@agents.moleculesai.app>
2026-05-11 12:15:29 +00:00
beea0e9b88 Merge branch 'main' into fix/canvas-purchase-success-modal-test-timing 2026-05-11 12:06:53 +00:00
2747246519 fix(ci): sweep-stale-e2e-orgs reference + drop continue-on-error (closes EC2 leak) (#461)
Co-authored-by: claude-ceo-assistant <claude-ceo-assistant@agents.moleculesai.app>
Co-committed-by: claude-ceo-assistant <claude-ceo-assistant@agents.moleculesai.app>
2026-05-11 12:05:36 +00:00
67762ca422 Merge branch 'main' into fix/canvas-purchase-success-modal-test-timing 2026-05-11 12:00:57 +00:00
71cfb70a6f Merge pull request 'fix(canvas/test): ApprovalBanner mockReset to prevent queue stacking' (#467) from fix/approvalbanner-mockreset-452 into main 2026-05-11 11:58:53 +00:00
c2d27d2b3f fix(canvas/test): ApprovalBanner mockReset to prevent queue stacking
Cherry-picked from PR #452 (fix/canvas-test-and-design-fixes) which
was closed without merge during the PR #443 cascade. The fix adds a
mockPost reference so individual tests can reset the POST mock cleanly
instead of queueing multiple resolved/rejected values.

Without this, the "shows an error toast when POST fails" and "keeps
the card visible when POST fails" tests queue two responses from
beforeEach's mockResolvedValue({}) and the second mockRejectedValueOnce()
call, causing non-deterministic test outcomes.

Fixes test failures in ApprovalBanner suite.
2026-05-11 11:51:21 +00:00
ce06b8cd59 Merge pull request 'fix(publish-runtime-autobump): shallow clone + explicit tag fetch (fixes main RED)' (#463) from fix/publish-runtime-autobump-fetch-depth into main
Merge #463 — strict-root cascade clearing
2026-05-11 11:46:15 +00:00
e0bbba801e Merge branch 'main' into fix/publish-runtime-autobump-fetch-depth 2026-05-11 11:39:14 +00:00