Commit Graph

13 Commits

Author SHA1 Message Date
security-auditor
a96f696ffb fix(ci): inline secret-scan body, drop cross-repo uses: of private molecule-core
All checks were successful
ci / mirror-guard (push) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (push) Successful in 6s
The 3-line wrapper at .github/workflows/secret-scan.yml referenced
`uses: molecule-ai/molecule-core/.github/workflows/secret-scan.yml@staging`.
molecule-core is private; act_runner clones cross-repo reusable
workflows anonymously, so the resolve fails at 0s with no logs.

Same root cause + same fix that molecule-controlplane already shipped
(see its secret-scan.yml comment block lines 10-22). Inlining keeps
the gate functional until Gitea is upgraded or the canonical scanner
moves to a public repo. When either lands, this file reverts to the
3-line wrapper.

Refs: internal#46 Phase 3 Class 2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 02:29:03 -07:00
security-auditor
d7ea277ce4 fix(ci): lowercase 'molecule-ai/' in cross-repo workflow refs
Some checks failed
Secret scan / secret-scan (pull_request) Failing after 0s
ci / mirror-guard (pull_request) Failing after 3s
Gitea is case-sensitive on owner slugs; canonical is lowercase
`molecule-ai/...`. Mixed-case `Molecule-AI/...` refs fail-at-0s
when the runner tries to resolve the cross-repo workflow / checkout.

Same fix as molecule-controlplane#12. Mechanical case-correction;
no behavior change beyond making CI resolve again.

Refs: internal#46

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 01:00:01 -07:00
Hongming Wang
05486e193c
Merge pull request #56 from Molecule-AI/chore/lockdown-as-mirror
Some checks failed
Secret scan / secret-scan (push) Failing after 0s
ci / mirror-guard (push) Successful in 9s
chore: lock down as publish artifact; source-of-truth is monorepo
2026-04-29 01:58:40 -07:00
rabbitblood
d381f20779 fix(ci): use molecule-core@staging — repo was renamed from molecule-monorepo, workflow lives on staging 2026-04-26 15:44:29 -07:00
rabbitblood
0b11d669b5 chore(ci): enroll in org-wide secret-scan reusable workflow
Calls the canonical workflow shipped in
Molecule-AI/molecule-monorepo#2109. Defense against the #2090-class
leak: a hosted-agent commit slipping a credential-shaped string into
a PR — caught at the PR layer, before merge.

Higher stakes here than most repos: this package publishes to PyPI,
so a leaked credential on a release tag would propagate to every
downstream tenant on next pip install.

Pattern set lives in molecule-monorepo so we don't maintain a
parallel copy here. Pairs with the runtime-side pre-commit hook
(scripts/pre-commit-checks.sh) which catches local commits before
they reach a PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 15:14:17 -07:00
Hongming Wang
96864263bb chore: lock down as publish artifact; source-of-truth is monorepo
This repo is now a publish artifact of Molecule-AI/molecule-core/workspace/.
Runtime code edits go to the monorepo; the publish-runtime workflow
regenerates this mirror + uploads to PyPI on every runtime-v* tag.

Changes:

- Delete .github/workflows/publish.yml. PyPI publishing now happens only
  from the monorepo's publish-runtime workflow. Without removing this,
  two different code shapes could reach PyPI depending on which workflow
  fired (the drift this lockdown is preventing).

- Delete .github/workflows/auto-promote-staging.yml. The staging→main
  fast-forward dance has no purpose on a mirror repo — the mirror is
  rebuilt wholesale on each release.

- Replace .github/workflows/ci.yml with a 'mirror-guard' job that fails
  on any pull_request event with a clear redirect message. Push events
  are still allowed (so existing in-flight branches don't all turn red
  while the migration finishes); that allowance becomes a follow-up
  removal once the auto-sync from monorepo is wired up.

- Rewrite README.md with a prominent ⚠ banner pointing at the monorepo.

- Add CONTRIBUTING.md with the explicit redirect table.

What this does NOT do:

- Wire up the auto-sync from monorepo → this repo. The
  publish-runtime workflow currently uploads to PyPI but doesn't push
  the rewritten tree back here. As a follow-up, extend that workflow
  with a step that commits the build dir to this repo's main. Until
  then this repo's contents will go stale relative to PyPI — but
  that's fine because no one should be reading code from here anyway.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-04-26 12:03:12 -07:00
Hongming Wang
d75a161ee8 fix(ci): sync auto-promote workflow (ff-only, no-gates mode) 2026-04-24 08:35:15 -07:00
Hongming Wang
f58d12bee2 chore(ci): add auto-promote-staging workflow 2026-04-24 07:43:56 -07:00
4bfe6222a6 fix(CI): remove conflicting bandit flags from security linter step
PR #31 added `-ll --severity-level=high` but these flags conflict:
  - `-ll` is a shorthand for `--level low` (only show low+ issues)
  - `--severity-level=high` suppresses everything but high-severity issues
The combination causes bandit to exit 2 because `--severity-level` is
not allowed alongside `-l/--level`. Use `--severity-level=high` alone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 00:58:43 +00:00
875a8ef952 fix(CI): set WORKSPACE_ID env var for test job
PR #29 introduced WORKSPACE_ID validation at module import time
(platform_auth.py). The CI environment did not set WORKSPACE_ID,
causing 8 failures + 13 errors on every main push. Add a dummy
CI-only value so imports succeed without affecting real workspaces.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 00:55:08 +00:00
molecule-ai[bot]
548549d5e9
feat(CI): add bandit security linter (audit rec #2) (#31)
Bandit runs on every PR against molecule_runtime/ at high severity.
Addresses audit recommendation from issue #9.

Co-authored-by: Molecule AI Infra-Runtime-BE <infra-runtime-be@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 00:23:17 +00:00
rabbitblood
9cdae9afec fix: switch top-level from adapters import to absolute imports (#1)
Every modular workspace template repo (claude-code, hermes, langgraph,
…) was crashing on boot with:

  KeyError: "Unknown runtime '<runtime>'. Available: "

Root cause: `molecule_runtime/main.py` and four other modules used
top-level imports like `from adapters import get_adapter` — a monorepo
legacy that resolved when something on sys.path had an `adapters/`
package. Standalone template repos COPY only `adapter.py` (singular) to
/app and don't ship an `adapters/` package, so this import path went
through some side-resolution that left `get_adapter` unable to see the
user's adapter. The ADAPTER_MODULE → import → getattr → issubclass
chain then silently fell through to the discovery branch and reported
"Unknown runtime".

Fix is one-line per file: `from adapters` → `from molecule_runtime.adapters`
in:
  - molecule_runtime/main.py:27
  - molecule_runtime/a2a_executor.py:44
  - molecule_runtime/coordinator.py:20
  - molecule_runtime/prompt.py:6
  - molecule_runtime/builtin_tools/temporal_workflow.py:417

Tests + CI added so this regression class is caught at PR time, not at
runtime in self-hosters' clusters:
  - tests/test_imports.py: parametrised import smoke for every previously
    affected module + a grep guard that fails if any future change
    reintroduces a top-level `from adapters` / `import adapters` line
  - .github/workflows/ci.yml: runs the smoke on every PR (no CI existed
    before — the publish workflow only fires on tag push)

Closes #1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 07:53:03 -07:00
Hongming Wang
851a6d7bfd feat: initial release of molecule-ai-workspace-runtime 0.1.0
Extracts shared workspace runtime from molecule-monorepo/workspace-template
into a publishable PyPI package.

- molecule_runtime/ package with all shared infrastructure modules
- Adapter discovery via ADAPTER_MODULE env var (standalone repos) + built-in scan
- molecule-runtime console script entry point (main_sync)
- CI workflow to publish on version tags
- Published to PyPI as molecule-ai-workspace-runtime==0.1.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 04:26:06 -07:00