Skip to content

Add sub-project 0: the SDK wrap point#38

Merged
xvrh merged 17 commits into
masterfrom
claude/upbeat-panini-9a445f
May 18, 2026
Merged

Add sub-project 0: the SDK wrap point#38
xvrh merged 17 commits into
masterfrom
claude/upbeat-panini-9a445f

Conversation

@xvrh

@xvrh xvrh commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

First sub-project of the command-wrapper tool — the riskiest piece. Wraps the flutter/dart scripts an IDE invokes so every run (CLI, AI, or IDE) is intercepted, classified, observed, and can have a --dart-define injected, degrading to plain passthrough on any failure.

  • De-risking spike result (docs/.../subproject-0-ide-launch-finding.md): IntelliJ launches runs as a direct flutter run --machine with --dart-define values in plain argv — so injection is a simple argv rewrite. The feared "daemon JSON-RPC proxy" branch was eliminated before any code was written.
  • What's delivered: a per-project SDK mirror facade (<project>/flutterware/sdk/, symlinks the pristine SDK + two bash shims), a pure-bash fast path (marker walk-up → classify → audit log → dispatch), the flutterware wrap run/install CLI (argv-rewrite --dart-define injection, PTY/pipe transport reusing phase-1 passthrough, local session sink), and an FW_MARKER probe widget in the example app.
  • Entirely dormant when merged: nothing in the existing codebase invokes it; the shims only exist after an explicit wrap install, and the shim only intercepts when a flutter_version marker is present (none is committed). The only modified production files are an optional, backward-compatible captureSink param on runUnderPty and a 5-line probe widget in examples/example.
  • Includes the implementation spec, plan, and a manual smoke-test checklist. Out of scope (later sub-projects): the daemon + DB + GUI, the back-channel, config.dart, and the walker/bootstrapper/SDK-download.

Test plan

  • 44 automated tests pass (cd app && flutter test test/wrap/ test/passthrough/) — dart-define injection, project/worktree resolution, session sink, transport, the wrap run command + degrade paths, and an end-to-end test driving the rendered bash shim.
  • Analyzer clean on all new/changed files; dart tool/prepare_submit.dart produces no diff.
  • Manual smoke test against a real IDE — see docs/superpowers/specs/2026-05-15-subproject-0-manual-smoke.md (compile the wrap exe, install the mirror, point IntelliJ at it, confirm flutter run is intercepted and FW_MARKER reaches the running app).

🤖 Generated with Claude Code

xvrh and others added 17 commits May 18, 2026 17:29
Brainstormed the two open decisions from the sub-project 0 scoping brief
(wrapped-script placement, noise classification) and ran a diagnostic spike
against IntelliJ. The spike found IntelliJ launches runs as a direct
`flutter run --machine` with --dart-define values in plain argv — so injection
is an argv rewrite, no daemon JSON-RPC proxy needed.

Also syncs the architecture doc and scoping brief from the design branch so
this work sits on the current design base.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task-by-task TDD plan for the SDK wrap point: dart-define injection, project
resolution, session sink, PTY/pipe transport, the wrap run command, the bash
shim template, the mirror installer, the probe app, and the manual smoke test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements `RunCommand` and `app/bin/wrap.dart`: resolves project context,
injects `--dart-define=FW_MARKER=<token>`, runs under the transport with
session capture, and degrades to a plain pass-through when outside a
flutterware project.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements installMirror() which builds a per-project facade at
<projectRoot>/flutterware/sdk/ — real bin/ directory with flutter/dart
shims, all other entries symlinked to the shared SDK — and wires it up
as the `install` subcommand of the wrap CLI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace single cascade `..createSync()` with `.createSync()` in
installer_test.dart to satisfy avoid_single_cascade_in_expression_statements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@xvrh
xvrh merged commit 92ea1e2 into master May 18, 2026
1 check passed
@xvrh
xvrh deleted the claude/upbeat-panini-9a445f branch May 18, 2026 16:19
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