Skip to content

wave 2: mink audit fixes (#135 #136 #137) + SSH (#127) + sharing (#129) + 11 benchmark scaffolds - #140

Merged
0bserver07 merged 6 commits into
masterfrom
feat/mink-wave2
Apr 25, 2026
Merged

wave 2: mink audit fixes (#135 #136 #137) + SSH (#127) + sharing (#129) + 11 benchmark scaffolds#140
0bserver07 merged 6 commits into
masterfrom
feat/mink-wave2

Conversation

@0bserver07

Copy link
Copy Markdown
Owner

Summary

Wave-2 follow-up after the v0.3.0 ship in #134/#138. 25-agent verification dispatch closed 8 issues and landed 7 scaffolds; this PR ships the 31 working-tree paths in 5 reviewable commits per research/mink/WAVE2-COMMIT-PLAN.md.

What's in

Audit closures (3 issues)

Scaffolds (2 issues)

  • Remote execution abstraction (SSH-backed agent OS) #127 SSH remote execution — chimera/env/ssh.py (stdlib subprocess proxy) + --remote ssh://user@host[:port]/path flag. 27 unit tests + 1 live-gated test (CHIMERA_SSH_TEST_HOST). Production hardening (asyncssh / SFTP) deferred per issue note.
  • Session sharing via URL #129 Session sharing — chimera/sessions/share.py with three sinks (gist, file, base64) + chimera mink runs share <id> --sink ... subcommand. 4 round-trip tests.

Benchmark adapters (11 issues left OPEN-WITH-NOTE)

11 new adapters under chimera/eval/benchmarks/: cline_bench, context_bench, dpai_arena, feature_bench, humaneval_plus, livecodebench, math500, mbpp, swe_polybench, swt_bench, tau_bench. Each implements the Benchmark ABC. Adapters are unit-tested; live runs against upstream datasets remain open for per-issue follow-up.

Cleanup

  • pyproject.toml mypy overrides for optional-extra benchmark deps (evalplus, no-any-return)
  • chimera/cli/agent_teams.py docstring trademark scrub
  • chimera/mink/cli.py docstring trademark scrub (CC parity → ecosystem parity)

Validation

Check Result
ruff All checks passed
mypy 0 errors / 489 source files
pytest 4263 passed / 80 skipped / 0 failed in 60s
trademark grep on live source zero hits
baseline vs wave2 +64 net new tests, 0 regressions

Issues this PR closes

Already closed via gh issue close during the wave: #116 #117 #118 #119 #129 #135 #136 #137. This PR ships the code that backs those closures + the 11 OPEN-WITH-NOTE benchmark scaffolds + the 2 scaffold-only OPEN issues (#127, #128).

Test plan

  • uv sync --extra dev --extra anthropic --extra mink
  • uv run pytest tests/ -q (expect 4263 passing)
  • uv run python -m chimera.cli.main mink runs share --help — new subcommand
  • uv run python -m chimera.cli.main mink --remote --help — new flag
  • uv run python -m chimera.cli.main mink -p "use bash to echo hi" --allowed-tools Bash --permission-mode bypassPermissions — H-22 filter
  • Browse docs/mink/{benchmarks.md,remote.md,runs.md} for the new docs

Deferred (not blocking ship)

🤖 Generated with Claude Code

0bserver07 and others added 6 commits April 25, 2026 16:48
Bundles every change to chimera/mink/cli.py landed by wave 2 since
they all touch the same file. Three audit findings closed in code
plus the --remote / runs share argparse plumbing the next two
commits' new modules attach to.

#135 (M-10) — RedactionMiddleware in stream-json:
  - chimera/mink/cli.py:1228 _build_stream_redaction()
  - chimera/mink/cli.py:1259 _redact_stream_line()
  - chimera/mink/cli.py:1297 _run_stream_json now routes every emit
    through the middleware via _emit() so secrets in tool_call args
    get redacted before stdout.
  - tests/mink/test_stream_json_redacts.py — 4 tests including an
    end-to-end repro with sk-ant-fake-leak-DEADBEEF.

#136 (M-17) — SessionResumeAgent Protocol:
  - chimera/sessions/session.py:48 SessionResumeAgent (runtime_checkable)
    with prompt: Any + tools: Any (bare Any to dodge Protocol attribute
    invariance against concrete Prompt + list[BaseTool]).
  - chimera/sessions/session.py + eventlog/session.py — Session.resume,
    EventSourcedSession.resume, EventSourcedSession.resume_from now
    accept SessionResumeAgent.
  - chimera/mink/cli.py:57 _ResumeAgentShim replaces 4 nested stub
    classes; cast() removed.
  - tests/mink/test_resume_protocol.py — 7 tests.

#137 (M-22) — --allowed-tools filter:
  - chimera/mink/cli.py:1182 _UnknownAllowedTool exception.
  - chimera/mink/cli.py:1190 _filter_allowed_tools() (case-insensitive).
  - chimera/mink/cli.py:1070 _run_print_mode applies the filter and
    exits 2 with stderr listing valid tools on miss.
  - tests/mink/test_allowed_tools_flag.py — 7 tests including
    subprocess CLI exercise.

Also lands the cli.py wiring for the next two commits' new modules:
the --remote argparse flag (commit 2 adds chimera/env/ssh.py) and
the runs share subcommand (commit 3 adds chimera/sessions/share.py).

Net: +18 new tests, full suite goes 4199 -> 4263 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#127 — Remote execution abstraction (SSH-backed agent OS):
  - chimera/env/ssh.py — SSHEnvironment(Environment), stdlib-only
    subprocess proxy. setup() probes ssh, run_bash/run_command/
    read_file/write_file/list_files/run_tests all wrap
    `subprocess.run(["ssh", host, ...])`. Custom port + identity +
    workdir all shlex-quoted.
  - chimera/mink/cli.py --remote ssh://user@host[:port]/path flag +
    _parse_remote_url + _build_environment factory (already in
    commit 1's cli.py diff).
  - tests/env/test_ssh_environment.py — 27 tests + 1 live-gated
    (CHIMERA_SSH_TEST_HOST). Asserts exact subprocess argv.
  - docs/mink/remote.md — user-facing reference.

#129 — Session sharing via URL:
  - chimera/sessions/share.py — export_to_url(session_id, sink) +
    import_from_url(url_or_path) round-trip. Sinks: gist (shells
    `gh gist create -p`), file (~/.chimera/exports/<id>.tar.gz),
    base64 (data: URI). gzip+tar packaging, path-traversal guards,
    tarfile.extractall(filter='data').
  - chimera mink runs share <id> --sink {gist,file,base64}
    subcommand (cli.py wiring in commit 1).
  - tests/sessions/test_share.py — 4 tests: file round-trip,
    base64 round-trip, unknown sink raises, CLI dispatch writes
    expected path.
  - docs/mink/runs.md — full runs CLI reference + Sharing section.

Both modules are stdlib-only; no new top-level deps. Production
hardening (asyncssh / SFTP / OAuth gist auth) deferred per per-issue
follow-up notes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#93 #94 #95 #96)

Eleven new benchmark adapters under chimera/eval/benchmarks/, each
implementing the existing Benchmark ABC with a problem loader,
grader, and (where the spec required) custom metrics. Adapters are
tested at the unit level; live runs against the upstream datasets
remain open in their respective issues for follow-up.

Adapters added:
- cline_bench.py (#87) — repo-based development eval
- context_bench.py (#91) — long-running context
- dpai_arena.py (#88) — multi-language developer tasks
- feature_bench.py (#86) — feature development eval, optional
  load_from_hub("LiberCoders/FeatureBench")
- humaneval_plus.py (#93) — extended HumanEval test cases (lazy
  evalplus import; mypy override added in commit 4)
- livecodebench.py (#95) — contamination-free coding with rotation
- math500.py (#96) — MATH-500 reasoning eval
- mbpp.py (#94) — basic programming, 974 problems
- swe_polybench.py (#92) — polyglot codebases, localization_accuracy
  + cst_node_recall metrics
- swt_bench.py (#89) — software testing generation, F2P pattern,
  unit_test + reproduction modes (15 unit tests at
  tests/eval/test_bench_swt.py)
- tau_bench.py (#90) — tool-use + business tasks (most relevant to
  mink's primary use case)

Plus chimera/eval/benchmarks/README.md documenting current baselines
(SWE-bench Lite 10%, Terminal-Bench 30%, HumanEval 90.9%) and
docs/mink/benchmarks.md (280 lines): per-benchmark status table +
how to run + how to add your own.

Issues remain OPEN-WITH-NOTE pending real dataset runs / Docker
wiring per their individual scopes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…demark scrub

- pyproject.toml — added two [[tool.mypy.overrides]] blocks. First
  extends import-not-found suppression to chimera.eval.benchmarks.
  humaneval_plus (evalplus extra not in dev sync). Second adds
  no-any-return suppression for chimera.eval.benchmarks.{tau_bench,
  cline_bench} where subprocess/library outputs are cast to bool
  without narrowing — acceptable inside trusted internal harnesses.
  Net: mypy back to 0 errors / 489 source files.
- chimera/cli/agent_teams.py — module docstring scrubbed; the
  "Mirrors Claude Code's agent-teams feature" line replaced with a
  capability description on its own terms.

After this commit: mypy clean, ruff clean, trademark grep on live
source returns zero hits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds links to docs/mink/benchmarks.md from both README.md (Links
list) and docs/mink/quickstart.md (Provider-choice section).
Two-line touches each, well under the standing rule's 5-line cap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI failure: 4 wave-2 test files transitively import chimera.mink.cli or
chimera.cli.render, both of which import rich (from the [mink] extra).
The CI test job runs `uv sync --extra dev --extra anthropic` (NOT
[mink]), so the subprocess CLI tests in test_allowed_tools_flag.py
crashed at import with ModuleNotFoundError instead of reaching the
M-22 filter and exiting 2.

Same pattern already used for tests/mink/test_mink_cli.py +
test_mink_settings_loader.py + several others — extend the guard to
the four wave-2 additions:
  - tests/mink/test_allowed_tools_flag.py
  - tests/mink/test_resume_protocol.py
  - tests/mink/test_stream_json_redacts.py
  - tests/env/test_ssh_environment.py

Locally the tests pass because [mink] is installed; CI will now skip
them cleanly when rich is absent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@0bserver07
0bserver07 merged commit 1afe69c into master Apr 25, 2026
7 checks passed
@0bserver07
0bserver07 deleted the feat/mink-wave2 branch April 25, 2026 20:56
0bserver07 added a commit that referenced this pull request May 10, 2026
docs/mink/parity-matrix.md:
- Added 5 v0.4.0 rows (16-20: SSH-remote, run persistence + sharing,
  agents subcommand, allowed-tools filter, stream-json).
- 3 footnotes linking #127 / #129 / #140.
- Updated counts (17 GREEN / 3 YELLOW of 20).
- Expanded follow-ups (#127, #128, #86-96, runs cost).

docs/mink/quickstart.md:
- Added v0.4.0 flag table (--remote, --allowed-tools, --tool-timeout,
  share/agents subcommands).
- 4 new env vars surfaced.
- NOTE pointer at the stale "What does NOT work yet" section.

docs/mink/{memory,output-formats,permissions,settings,slash-commands,
subagents}.md: trademark scrub — replaced direct brand mentions with
neutral language ("ecosystem parity", "the open source coding agent",
"the upstream"). Live-source scope (README + docs/mink + chimera +
examples + pyproject) is now clean.

Historical references in docs/benchmarks/ and docs/plans/ remain — out
of scope for live-source scrub (factual integration history).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant