Commit Graph

942 Commits

Author SHA1 Message Date
Hongming Wang
99571efb62 chore: move internal docs to Molecule-AI/internal (private)
Moved to private repo so the public monorepo only contains docs
useful for contributors and users:

Removed (now in Molecule-AI/internal):
- edit-history/ — 15 daily dev session logs
- retrospectives/ — session postmortems with ops details
- marketing/ — competitor analysis, SEO strategy, landing briefs
- product/ — PRD, SaaS strategy, growth research
- runbooks/ — SaaS ops (secrets rotation, GDPR, admin auth)
- security/ — internal security advisories
- research/ — competitive framework analysis
- ecosystem-watch.md — competitive landscape tracking
- demo/, spikes/ — internal prototypes
- known-issues.md, remote-workspaces-readiness.md

Also removed duplicate docs/architecture.md (superseded by
docs/architecture/overview.md).

Remaining public docs: architecture, API reference, adapters,
agent-runtime, plugins, guides, tutorials, development, frontend,
integrations, glossary, quickstart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:47:41 -07:00
Hongming Wang
e231c74701 Merge pull request #945 from Molecule-AI/chore/gitignore-claude-md-add-docs
chore: gitignore CLAUDE.md, extract architecture + API docs
2026-04-18 00:44:36 -07:00
Hongming Wang
0d3c57cced chore: gitignore CLAUDE.md, extract content to proper docs
CLAUDE.md was a 44KB catch-all mixing architecture docs (useful for
everyone) with agent operating instructions (internal). Split:

- docs/architecture/overview.md — system architecture, component
  descriptions, 13 key patterns (import cycles, health detection,
  communication rules, WebSocket flow, lifecycle, etc.)
- docs/api-reference.md — full REST API route table + database schema
- CLAUDE.md → gitignored (stays local for agent tooling)

All internal PR/issue references stripped from the new docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:43:33 -07:00
Hongming Wang
c3675bd8b7 Merge pull request #944 from Molecule-AI/chore/open-source-final-fixes
chore: final open-source cleanup — binary, stale paths, private refs
2026-04-18 00:39:12 -07:00
Hongming Wang
39074cc4ae chore: final open-source cleanup — binary, stale paths, private refs
- Remove compiled workspace-server/server binary from git
- Fix .gitignore, .gitattributes, .githooks/pre-commit for renamed dirs
- Fix CI workflow path filters (workspace-template → workspace)
- Replace real EC2 IP and personal slug in test_saas_tenant.sh
- Scrub molecule-controlplane references in docs
- Fix stale workspace-template/ paths in provisioner, handlers, tests
- Clean tracked Python cache files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:38:55 -07:00
Hongming Wang
a79dec0a86 Merge pull request #943 from Molecule-AI/fix/remaining-platform-refs
fix: last stale platform/ refs in scripts, tests, compose
2026-04-18 00:32:08 -07:00
Hongming Wang
ca7e9972ff fix: remaining platform/ path references in scripts, tests, compose
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:32:03 -07:00
Hongming Wang
5344fccf64 Merge pull request #942 from Molecule-AI/fix/dockerfile-gosum-path
fix: Dockerfile go.sum path after workspace-server rename
2026-04-18 00:31:27 -07:00
Hongming Wang
c254cd7459 fix: Dockerfile go.sum path after platform → workspace-server rename
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:31:16 -07:00
Hongming Wang
25aeb2f746 Merge pull request #941 from Molecule-AI/fix/railway-build-context
fix: railway.toml buildContext for workspace-server rename
2026-04-18 00:29:51 -07:00
Hongming Wang
c40c6e8424 fix: railway.toml buildContext must be repo root for workspace-server COPY paths
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:29:38 -07:00
Hongming Wang
0f5feaa582 Merge pull request #940 from Molecule-AI/chore/open-source-prep
chore: open-source preparation — scrub secrets, add community files
2026-04-18 00:27:19 -07:00
Hongming Wang
d8026347e5 chore: open-source restructure — rename dirs, remove internal files, scrub secrets
Renames:
- platform/ → workspace-server/ (Go module path stays as "platform" for
  external dep compat — will update after plugin module republish)
- workspace-template/ → workspace/

Removed (moved to separate repos or deleted):
- PLAN.md — internal roadmap (move to private project board)
- HANDOFF.md, AGENTS.md — one-time internal session docs
- .claude/ — gitignored entirely (local agent config)
- infra/cloudflare-worker/ → Molecule-AI/molecule-tenant-proxy
- org-templates/molecule-dev/ → standalone template repo
- .mcp-eval/ → molecule-mcp-server repo
- test-results/ — ephemeral, gitignored

Security scrubbing:
- Cloudflare account/zone/KV IDs → placeholders
- Real EC2 IPs → <EC2_IP> in all docs
- CF token prefix, Neon project ID, Fly app names → redacted
- Langfuse dev credentials → parameterized
- Personal runner username/machine name → generic

Community files:
- CONTRIBUTING.md — build, test, branch conventions
- CODE_OF_CONDUCT.md — Contributor Covenant 2.1

All Dockerfiles, CI workflows, docker-compose, railway.toml, render.yaml,
README, CLAUDE.md updated for new directory names.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:24:44 -07:00
Hongming Wang
bc96b9ff69 chore: move platform/docs/adr/ to root docs/adr/ — single docs location
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:12:47 -07:00
Hongming Wang
295c4d930a chore: open-source preparation — scrub secrets, add community files
Security:
- Replace hardcoded Cloudflare account/zone/KV IDs in wrangler.toml
  with placeholders; add wrangler.toml to .gitignore, ship .example
- Replace real EC2 IPs in docs with <EC2_IP> placeholders
- Redact partial CF API token prefix in retrospective
- Parameterize Langfuse dev credentials in docker-compose.infra.yml
- Replace Neon project ID in runbook with <neon-project-id>

Community:
- Add CONTRIBUTING.md (build, test, branch conventions, CI info)
- Add CODE_OF_CONDUCT.md (Contributor Covenant 2.1)

Cleanup:
- Replace personal runner username/machine name in CI + PLAN.md
- Replace personal tenant URL in MCP setup guide
- Replace personal author field in bundle-system doc
- Replace personal login in webhook test fixture
- Rewrite cryptominer incident reference as generic security remediation
- Remove private repo commit hashes from PLAN.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 00:10:56 -07:00
Hongming Wang
18f3a03aef Merge pull request #939 from Molecule-AI/docs/tunnel-migration-report
docs: Cloudflare Tunnel migration report + Worker source
2026-04-17 23:59:54 -07:00
Hongming Wang
bfdb0e3b69 docs: Cloudflare Tunnel migration report + track Worker source
- Full session retrospective: tunnel E2E verified on prod + staging subdomains
- Worker source tracked in infra/cloudflare-worker/ (was only in /tmp)
- Worker changes: reserved slug passthrough + multi-level subdomain bypass
- Known issues, follow-ups, cost impact, key learnings documented

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 23:58:55 -07:00
Hongming Wang
c871e1209a Merge pull request #938 from Molecule-AI/fix/a11y-team-member-chip
fix(canvas): add a11y to TeamMemberChip — keyboard nav + ARIA
2026-04-17 21:53:54 -07:00
Hongming Wang
a6caf0b138 fix(canvas): add a11y attributes to TeamMemberChip — role, aria-label, keyboard nav
Adds role="button", tabIndex, aria-label="Select <name>", and keyboard
handlers (Enter/Space) to TeamMemberChip. Fixes 5 failing a11y tests
from issue #831. Updates eject button test to match existing label format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 21:53:39 -07:00
Hongming Wang
9674f238bb Merge pull request #937 from Molecule-AI/fix/vet-errors-supply-chain
fix(platform): resolve go vet errors + supply chain hardening
2026-04-17 21:50:37 -07:00
Hongming Wang
e80c170e36 fix(platform): resolve go vet errors + implement supply chain hardening (#768)
- Add supply_chain.go with VerifyManifestIntegrity (SHA256 content check)
- Add pinned-ref enforcement to GithubResolver.Fetch (rejects bare org/repo)
- Fix duplicate TestSlackAdapter_Type across channels_test.go and slack_test.go
- Fix sync.Once lock copy in audit_test.go resetAuditKeyCache
- Fix slack_test.go horizontal rule expectations to match implementation
- Existing tests updated with PLUGIN_ALLOW_UNPINNED=true for bare-ref specs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 21:50:18 -07:00
Hongming Wang
f1aee68013 Merge pull request #929 from Molecule-AI/feat/issue-837-temporal-checkpoint-step3
feat(checkpoints): Temporal crash-resume — GET /checkpoints/latest + history injection (closes #583)
2026-04-17 21:45:01 -07:00
Hongming Wang
99c1ff686e Merge pull request #921 from Molecule-AI/feat/issue-753-audit-trail-panel
feat(canvas): audit trail visualization panel (closes #753)
2026-04-17 21:44:58 -07:00
Hongming Wang
3e30f4e5fd Merge pull request #915 from Molecule-AI/feat/issue-852-hermes-runtime
feat(plugins): extend runtime declarations to hermes — 5 SKILL.md plugins
2026-04-17 21:44:55 -07:00
Hongming Wang
5bae8014ce Merge pull request #879 from Molecule-AI/fix/canvas-test-fixture-budgetlimit
fix(canvas): repair TypeScript fixture drift in BudgetLimit and test factories
2026-04-17 21:44:52 -07:00
Hongming Wang
eb9f063539 Merge pull request #925 from Molecule-AI/fix/issue-893-hitl-audit-log
fix(hitl): emit log_event() on approval grant and denial — Art. 14 audit gap (closes #893)
2026-04-17 21:43:00 -07:00
Hongming Wang
d7324fdbfd Merge pull request #913 from Molecule-AI/fix/issue-834-commit-memory-secret-scrub
fix(security): redact secrets from commit_memory before persistence (closes #834)
2026-04-17 21:42:57 -07:00
Hongming Wang
5e0795e4ea Merge pull request #849 from Molecule-AI/docs/partner-api-keys
docs: Partner API Keys — programmatic org management (Phase 34)
2026-04-17 21:41:46 -07:00
Hongming Wang
b0eed5135f fix: resolve PLAN.md merge conflict — keep both Phase 34 and Phase 36
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 21:41:32 -07:00
Hongming Wang
afe537c9b0 Merge pull request #927 from Molecule-AI/chore/eco-watch-2026-04-18
chore(eco-watch): 2026-04-18 daily sweep — chrome-devtools-mcp + craft-agents-oss + BLOCK MemPalace
2026-04-17 21:40:29 -07:00
Hongming Wang
907d4cc154 Merge pull request #880 from Molecule-AI/docs/safe-mcp-advisory-2026-04-17
docs(security): SAFE-MCP internal advisory 2026-04-17
2026-04-17 21:40:26 -07:00
Hongming Wang
581ccefe89 Merge pull request #922 from Molecule-AI/infra/issue-894-anthropic-api-key-docs
docs(infra): document ANTHROPIC_API_KEY as required global secret (closes #894)
2026-04-17 21:40:23 -07:00
Hongming Wang
abd4710298 Merge pull request #934 from Molecule-AI/feat/cloudflare-tunnel-per-tenant
docs: staging environment design + Phase 36 + Tunnel migration plan
2026-04-17 21:40:14 -07:00
rabbitblood
3bd96caa8a fix(provisioner): strip CRLF from .sh/.py/.md in CopyTemplateToContainer
Second layer of the permanent CRLF fix. The Go provisioner now strips
\r\n → \n from shell, Python, and markdown files during the tar
copy into containers.

Three-layer CRLF defense:
1. Provisioner (this) — strips during template copy
2. Entrypoint.sh — strips at boot (safety net)
3. Runtime plugin installer (builtins.py) — strips during plugin install

Any one layer is sufficient. All three together make CRLF impossible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 21:37:55 -07:00
Hongming Wang
a873ae0eae docs: staging environment design + Phase 36 plan
Full staging environment that mirrors production. Every infra change
ships to staging first before promotion. Gates Phase 33 (Tunnel) and
Phase 35 (security hardening).

Components: Railway staging env, Neon branch, staging DNS, tagged
Docker images, promotion workflow, automated smoke tests.

Also marks Phase 33 as migrating from Worker to Cloudflare Tunnel
(issue #933), prerequisite: staging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 20:37:11 -07:00
Hongming Wang
a8b4a77ce5 Merge pull request #930 from Molecule-AI/fix/ci-path-filter-merge-commits
fix(ci): path filter for merge commits — use event.before
2026-04-17 20:23:44 -07:00
Hongming Wang
e093f121f0 fix(ci): use github.event.before for push diff, fetch-depth 0
HEAD~1 doesn't work for merge commits. Use github.event.before (the
previous main tip) for push events and github.event.pull_request.base.sha
for PRs. fetch-depth: 0 ensures both SHAs are available.

Fallback: if BASE is empty (new branch), run all jobs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 20:23:28 -07:00
Molecule AI Backend Engineer
384bea6102 feat(checkpoints): Temporal crash-resume — GET latest checkpoint + history injection (#837, closes #583)
Adds the final step (3/3) of the durable Temporal resume path:

Platform (Go):
- `Latest` handler: GET /workspaces/:id/checkpoints/latest returns the
  most recently completed step across all workflows for the workspace,
  ordered by completed_at DESC. Returns 404 when no checkpoints exist.
- Router: registers the new route BEFORE the wildcard :wfid route to
  avoid shadowing; callerMismatch guard enforces workspace isolation.
- 4 new unit tests: 200, 500, 404 (ErrNoRows), and 403 (caller mismatch).

Workspace runtime (Python):
- `_fetch_latest_checkpoint()`: non-fatal async helper that GETs the
  new endpoint and returns the parsed dict, or None on 404 / any error.
- `TemporalWorkflowWrapper.run()`: on startup, fetches the latest
  checkpoint and prepends a synthetic [system, ...] entry to the
  serialised AgentTaskInput.history so the agent is aware of its prior
  crash state before receiving the current task.
- 4 new pytest tests: 404→None, 200→dict, exception→None (non-fatal
  contract), and end-to-end injection into AgentTaskInput.history.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 03:22:31 +00:00
Hongming Wang
ee8b8af962 Merge pull request #928 from Molecule-AI/fix/ci-path-filter-macos
fix(ci): replace dorny/paths-filter with git diff — unblocks all CI
2026-04-17 20:16:55 -07:00
Hongming Wang
310fc56f96 fix(ci): replace dorny/paths-filter with git diff (macOS compat)
dorny/paths-filter uses Docker internally which doesn't work on the
self-hosted macOS arm64 runner — every CI run since the path filter
change has failed with no jobs.

Replace with a simple git diff against HEAD~1 that checks path prefixes.
Same behavior, no Docker dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 20:16:39 -07:00
Molecule AI Research Lead
8930488690 chore(eco-watch): resolve merge conflict — keep BLOCKED MemPalace + run b entries
Remote had the pre-fraud-audit MemPalace WATCH entry. Resolved by keeping
HEAD: BLOCKED/FRAUD verdict (SA audit 2026-04-18) plus the two new run-b
entries (chrome-devtools-mcp, craft-agents-oss).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 03:14:23 +00:00
Molecule AI Research Lead
f0a1bff27f chore(eco-watch): add chrome-devtools-mcp + craft-agents-oss — 2026-04-18 run b
Two new entries from daily sweep (TR GitHub trending + CI social feeds):

- chrome-devtools-mcp (ChromeDevTools/chrome-devtools-mcp, 35.9k★): Official
  Google Chrome DevTools MCP server — 29 tools for browser control, network
  inspection, Lighthouse audits. Strong MCP adoption signal from Google.
  GH #926 filed: add as bundled MCP server option in workspace templates.

- craft-agents-oss (lukilabs/craft-agents-oss, 4.3k★): Electron desktop app
  on Claude Agent SDK — multi-session inbox, 3-tier permissions, MCP support.
  Single-user desktop vs. Molecule's multi-tenant org-graph. UX reference for
  approval queue / permission tier UI.

CI sweep clean (no additional findings). RevoClaw near-miss logged (outside
24h window, no public repo yet).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 03:12:59 +00:00
Molecule AI Backend Engineer
04e2f37b95 fix(hitl): emit log_event() on approval grant and denial — Art. 14 audit gap (closes #893)
The @requires_approval decorator and request_approval() call executed the
approval gate correctly but never wrote the outcome to the activity log.
EU AI Act Article 14 requires documented evidence that HITL measures were
exercised — the missing log_event() calls meant GET /workspaces/:id/activity
could not surface HITL gate outcomes.

Add log_event() at both resolution points in the requires_approval wrapper:
- Denial: event_type="hitl", action="approve", outcome="denied", actor=decided_by
- Grant:  event_type="hitl", action="approve", outcome="granted", actor=decided_by

Both calls follow the existing try/except pattern used for audit calls elsewhere
in hitl.py so a missing audit module never blocks the approval flow.

Tests: TestRequiresApproval.test_logs_hitl_denied_event and
test_logs_hitl_approved_event verify log_event is called with the correct
outcome on each resolution path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 03:10:26 +00:00
Hongming Wang
7e8eff2fe5 Merge pull request #924 from Molecule-AI/docs/session-retrospective-2026-04-17
docs: SaaS buildout retrospective + Phase 35 hardening plan
2026-04-17 20:10:02 -07:00
Hongming Wang
da0be04a19 docs: session retrospective + Phase 35 hardening plan
Full retrospective of the 2026-04-16/17 SaaS buildout session:
- What was done (infra migration, 40+ PRs, 5 issues, 4 docs, 1 new repo)
- What should NOT have been changed (wildcard DNS churn, AdminAuth shortcut)
- Security concerns (8 items, 2 CRITICAL)
- Workflow gaps (registration, boot time, CI)
- Tests needed (automated + manual + security)

Phase 35 in PLAN.md covers production hardening follow-ups.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 20:08:39 -07:00
638427e01b docs(infra): document ANTHROPIC_API_KEY as required global secret (closes #894)
- Add comment to .env.example explaining ANTHROPIC_API_KEY must be set
  as a *global* secret (not just workspace-level) so SDK-direct workspaces
  (e.g. molecule-hitl, hermes) receive it without 401 errors
- Add ANTHROPIC_API_KEY to saas-secrets.md secret map with context on
  why global propagation matters
- Add full rotation procedure section (generate → PUT /settings/secrets
  → verify restart → revoke old key) with blast-radius note

Closes #894

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 03:03:37 +00:00
rabbitblood
eabca3679e fix: auto-post only to Slack, never Telegram
BroadcastToWorkspaceChannels now filters channel_type='slack'.
Telegram is CEO-only — explicit escalations via agent's outbound call,
never auto-posted from cron output. PM's routine pulses and agent
errors were spamming the CEO's Telegram.

PM's Telegram channel stays enabled for POLLING (inbound CEO messages)
but BroadcastToWorkspaceChannels skips it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 19:04:31 -07:00
Molecule AI Research Lead
ab11c20730 chore(eco-watch): BLOCK MemPalace — coordinated fraud (SA audit 2026-04-18)
SA forensic audit found: 89% bot-farmed stars (42k of 47.6k), malware
domain mempalace.tech, deleted PyPI maintainer (supply-chain risk),
unpatched ChromaDB RCE (#6717), non-existent PyPI package (squattable),
unsafe HuggingFace pickle loading, and crypto pump-and-dump association.
Verdict changed from WATCH to BLOCKED/FRAUD. GH #912 plugin proposal
is closed per audit verdict.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 01:48:03 +00:00
Molecule AI Research Lead
806ef6403c chore(eco-watch): add MemPalace + update Google ADK — 2026-04-18 run a
- MemPalace (milla-jovovich/mempalace, 47.6k★, MIT, Python): local-first agent
  memory using Method of Loci; 29 MCP tools; 96.6% R@5 on LongMemEval; native
  Claude Code .claude-plugin integration. Verdict: WATCH
- Google ADK: update to v1.31.0 (Apr 17 2026) — multi-language parity
  (Python/TS/Java/Go), native A2A (full protocol, Linux Foundation standard).
  Platform gaps confirmed open (no scheduling, no cross-agent HITL).
  Verdict: WATCH maintained with enhanced escalation triggers.
2026-04-18 01:47:20 +00:00
molecule-ai[bot]
c65150edf6 Merge pull request #891 from Molecule-AI/fix/issue-826-smol-executor-env-sanitization
feat(security): denylist env sanitization + safe messaging for smolagents
2026-04-18 01:44:26 +00:00