Skip to content

feat(virtual): complete JavaScript and Rust ecosystem parity - #116

Open
konard wants to merge 8 commits into
mainfrom
issue-30-a0052265
Open

konard wants to merge 8 commits into
mainfrom
issue-30-a0052265

Conversation

@konard

@konard konard commented Sep 9, 2025 •

Copy link
Copy Markdown
Member

Summary

Complete issue #30's virtual command ecosystem in JavaScript and Rust, with substantive implementations, runnable examples, and acceptance coverage in both languages. Remove parity-exempt as requested in the follow-up review.

JavaScript's $.create(null, handler) previously selected the configured-tag overload, and internal registration coerced non-string names through its regex. Registration now rejects those names before mutation while preserving create(options), valid names, ESM and CommonJS.

Rust now supports real registry discovery, idempotent manifest/npm installation, atomic reload, and in-process manifest watching. It retains typed async handlers and adds optional replacement/restoration, cancellable process streaming, ten typed example packages, and ecosystem/enterprise demos. Reproduced fixes reject built-in package collisions, preserve composition cancellation and streamed intermediate output, decode split UTF-8 correctly, and interrupt output sends when a paused consumer would block cancellation.

Behavior and documentation

  • Both languages support packages, install/create/extend, inheritance, middleware, composition, incremental output, marketplace discovery, and development reload.
  • Rust uses typed closures and literal-argv command-stream.json manifests. npm providers can ship a JavaScript entry and a Rust-compatible manifest together; arbitrary JavaScript function exports require a typed Rust counterpart or executable command. Rust's default marketplace transport requires curl; npm installation requires npm and disables lifecycle scripts.
  • JavaScript ecosystem guide and coverage matrix and Rust ecosystem guide and coverage matrix document the supported contracts.
  • Both catalogs contain ten installable example packages and offline ecosystem/enterprise demonstrations. Publication, external adoption and production deployment remain post-release outcomes.
  • Expanded executable feature comparisons check invalid names, streamed composition, atomic reload and discovery metadata across Rust, Node and Bun. JavaScript patch changeset and Rust minor changelog fragment prepare releases. Both Rust lockfiles are refreshed to the compatible syn 3.0.9 release required by CI freshness policy. The offline npm fixture uses an isolated cache and disables update checks; its original deadline and real installation assertions remain intact.

Reproduction and validation

The six JavaScript invalid-name tests failed before the registration fix. Rust regression tests first reproduced built-in collisions and lost composition cancellation, then split UTF-8 corruption and cancellation blocked by a full channel. Preserved failing output and root-cause notes are in the investigation.

CI=true bun test js/tests/ --timeout 10000
cargo test --manifest-path rust/Cargo.toml --all-features
cargo test --manifest-path rust/Cargo.toml --test command_packages --test virtual_ecosystem --test example_packages --test package_streaming
node scripts/check-parity.mjs
cargo run --manifest-path rust/Cargo.toml --example virtual_ecosystem
cargo run --manifest-path rust/Cargo.toml --example enterprise_virtual_commands

Local validation: 2,753 JavaScript tests passed (10 skipped), 876 Rust tests passed (7 ignored), and 21 focused Rust ecosystem tests passed. All 34 executable feature comparisons passed in Rust, Node and Bun; both new Rust demos completed. Rust format/Clippy/rustdoc, JavaScript ESLint/Prettier/type/duplication checks, 227 documentation checks, and all 36 generated files passed. Logs, including one transient failure in an unchanged graceful-shutdown test followed by passing isolated/full reruns, are preserved in validation evidence.

Issue #30 is already closed by #225; this PR preserves main's replacement architecture and completes the reviewed support and regression coverage.

Final CI

All seven workflows passed for final commit 68f4aae73a8959ed36ada3147a3e52b800806049: JavaScript, Rust on Linux/macOS/Windows, language parity, dependency freshness, repository quality, benchmarks, and security. There are 47 passing checks, no failures or pending checks, and six release checks intentionally skipped on pull requests. The parity exemption is removed.


Fixes #30

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #30
@konard konard self-assigned this Sep 9, 2025
konard and others added 2 commits September 9, 2025 21:33
This commit establishes virtual commands as the killer feature no competitor can match by creating a complete ecosystem for extensible shell commands.

## 🚀 Revolutionary Features Added:

### Package System
- `$.install('npm-package-name')` - Install command packages with automatic registration
- Mock package resolver with realistic packages (@command-stream/git-tools, file-tools, deploy-tools)
- Package versioning and dependency management
- Force reinstallation support

### Custom Command Creation
- `$.create('my-cmd', handler)` - Create custom virtual commands
- Support for async generators for streaming commands
- Built-in error handling and performance tracking
- Command metadata storage and lifecycle management

### Command Extension & Middleware
- `$.extend('existing-cmd', middleware)` - Extend commands with middleware
- Pre/post middleware hooks for command transformation
- Multiple middleware layers with proper chaining
- Simple function or object-based middleware patterns

### Command Composition
- `$.compose('new-cmd', [commands], options)` - Compose multiple commands
- Pipeline mode for stdin/stdout chaining
- Sequence mode for accumulating outputs
- Error handling with continue-on-error options

### Marketplace & Discovery
- `$.marketplace.search('query')` - Search available packages
- `$.marketplace.info('package')` - Get detailed package information
- `$.marketplace.list()` - List installed packages
- Ranking by downloads, ratings, and relevance

### Development Features
- Hot-reloadable commands for development workflow
- `$.hotReload(name, filePath)` - Enable file watching
- Comprehensive ecosystem state management
- Type-safe command interfaces and validation

## 🏢 Enterprise Capabilities:

### Production-Ready Workflows
- Environment validation commands
- Security scanning and compliance checks
- Performance monitoring with streaming metrics
- Deployment pipeline composition
- CI/CD integration examples

### Developer Experience
- Comprehensive test suite (36 tests, all passing)
- Interactive demos showcasing all features
- Enterprise workflow examples
- Error handling and edge case coverage

## 📦 Package Structure:
- `src/$.mjs` - Core ecosystem implementation (~600 lines added)
- `tests/virtual-ecosystem.test.mjs` - Complete test coverage
- `examples/virtual-ecosystem-demo.mjs` - Feature demonstration
- `examples/enterprise-virtual-commands.mjs` - Enterprise workflows
- Version bump to 0.8.0 for major feature release

## 🔥 Benefits No Competitor Has:
✅ Extensible shell environment with JavaScript-native development
✅ Package ecosystem for shell commands (npm-like for terminal)
✅ Hot development workflow with live reloading
✅ Type-safe command interfaces and composition
✅ Enterprise-grade deployment and security workflows
✅ Streaming virtual commands with async generators
✅ Middleware system for command enhancement
✅ Marketplace for command discovery and sharing

This establishes command-stream as the definitive solution for modern shell scripting with an ecosystem that competitors cannot match.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Advanced virtual commands ecosystem and marketplace 🚀 Advanced Virtual Commands Ecosystem and Marketplace Sep 9, 2025
@konard
konard marked this pull request as ready for review September 9, 2025 18:43
@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

We need to double check we fully support all planned features, everything is covered with tests and fully documented.

@konard
konard marked this pull request as draft October 12, 2026 13:02
@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Started at 2026-10-12T13:02:21.868Z. Please wait for it to finish before giving feedback.

Runtime: solve v2.35.8 · tool codex · model gpt-6.1-sol · task image konard/hive-mind-dind:2.35.8@sha256:9706ce436565c715d6c2b95f615b51fa8c8ee96ddbbf56d98201e6861fdc60e9

@konard konard added the parity-exempt Change is intentionally single-language; skip JS/Rust parity check label Oct 12, 2026
@konard konard changed the title 🚀 Advanced Virtual Commands Ecosystem and Marketplace fix(virtual): validate command names and complete ecosystem coverage Oct 12, 2026
@konard
konard marked this pull request as ready for review October 12, 2026 13:36
@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Updated PR #116 and marked it ready for review.

Resolved merge conflicts, fixed command-name validation, and added ecosystem tests and documentation.

Validation: 2,753 JavaScript tests and 855 Rust tests passed. CI is green: 40 checks passed, 3 skipped. Working tree is clean.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-6.1 Sol
  • Provider: OpenAI
  • Public pricing estimate: $2.478811

📊 Context and tokens usage:

  • 201.5K / 272K (74%) input tokens, 37.5K / 128K (29%) output tokens

Total: (201.5K + 5.6M cached) input tokens, 37.5K output tokens, $2.478811 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-6.1-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-6.1 Sol (gpt-6.1-sol)

📎 Log file uploaded as Gist (3937KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

⚠️ Auto-merge blocked: this pull request is ready, but it was not merged automatically

All merge requirements are satisfied — CI passed, there are no conflicts, and there are no pending changes.

Auto-merge (--auto-merge) was requested but is being held back:

What to do next:


Reported automatically by hive-mind with the --auto-merge flag.

@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

parity-exempt must be removed, we must fully support this pull request in all programming languages we have.

@konard
konard marked this pull request as draft October 12, 2026 14:02
@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Started at 2026-10-12T14:02:57.546Z. Please wait for it to finish before giving feedback.

Runtime: solve v2.35.8 · tool codex · model gpt-6.1-sol · task image konard/hive-mind-dind:2.35.8@sha256:9706ce436565c715d6c2b95f615b51fa8c8ee96ddbbf56d98201e6861fdc60e9

@konard konard removed the parity-exempt Change is intentionally single-language; skip JS/Rust parity check label Oct 12, 2026
@konard konard changed the title fix(virtual): validate command names and complete ecosystem coverage feat(virtual): complete JavaScript and Rust ecosystem parity Oct 12, 2026
@konard
konard marked this pull request as ready for review October 12, 2026 16:36
@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Updated PR #116 and marked it ready for review.

  • Removed parity-exempt; added Rust ecosystem support, tests, examples and documentation.
  • Passed 2,753 JavaScript tests, 876 Rust tests and 34 feature comparisons.
  • All CI workflows pass. Working tree is clean; latest main is included.

This summary was automatically extracted from the AI working session output.

@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-6.1 Sol
  • Provider: OpenAI
  • Public pricing estimate: $4.533723

📊 Context and tokens usage:

  • 433.8K input tokens across requests (cumulative, larger than the 272K context window, so not one request's context), 70.4K / 128K (55%) output tokens

Total: (433.8K + 8.7M cached) input tokens, 70.4K output tokens, $4.533723 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-6.1-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-6.1 Sol (gpt-6.1-sol)

📎 Log file uploaded as Gist (6866KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No uncommitted changes

Note: Issue #30 has been closed. Reopen issue #30 so auto-merge can complete, or merge this pull request manually.

This branch has not been deployed

No deployments
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.

Advanced virtual commands ecosystem and marketplace

1 participant