Add exitCode alias for code property#112
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #36
- Added exitCode as an alias for the code property in all result objects - Updated createResult function to include exitCode property - Modified all direct object creations with code property to include exitCode - Updated virtual command execution path to include exitCode - Added comprehensive tests for exitCode alias functionality - Ensures backward compatibility while providing the requested alias Fixes #36 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Get latest changes from default branch, and ensure everything is applied to both JavaScript and Rust. |
|
🤖 AI Work Session Started Starting automated work session at 2026-06-10T22:21:50.715Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
- Resolve monorepo restructure conflict (src/ -> js/src, tests/ -> js/tests) - JS: add exitCode alias for code in createResult and centralized finish() - Rust: add CommandResult::exit_code() accessor mirroring the JS alias - Move exitCode test to js/tests, add Rust parity test - Add changeset/changelog fragments for both languages
Working session summaryEverything is complete. Here's a summary of the work done on PR #112 for issue #36: SummaryThe PR comment asked to "Get latest changes from default branch, and ensure everything is applied to both JavaScript and Rust." The merge status was DIRTY because What I did
Verification
PR: #112 This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $2.883328📊 Context and tokens usage:
Total: (4.5K new + 58.0K cache writes + 3.9M cache reads) input tokens, 21.5K output tokens, $2.883328 cost 🤖 Models used:
📎 Log file uploaded as Gist (1892KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
exitCodealias for thecodeproperty across both the JavaScript and Rust implementations (issue Add exitCode alias for code #36).main(monorepo restructure:src/→js/src/,tests/→js/tests/) into the branch and re-applied the change to the new modular layout.codeproperty is unchanged.Implementation Details
JavaScript (
js/)createResult(js/src/$.result.mjs) now includesexitCode: code.finish()(js/src/$.process-runner-base.mjs) — the single choke point every result passes through before being returned to the user — normalizesexitCodefromcode, so every execution path (simple commands, pipelines, virtual commands, sequences) exposes the alias without patching dozens of literal result objects.Rust (
rust/)CommandResult::exit_code()accessor (rust/src/utils.rs) as the idiomatic alias for thecodefield, mirroring the JSexitCodealias.Docs & release
js/README.mdandrust/README.md.js/.changeset/exitcode-alias.md,minor) and a Rust changelog fragment (rust/changelog.d/...,minor).Test plan
js/tests/exitcode-alias.test.mjs— covers basic alias, matching values, success/failure, and pipeline scenarios (5 tests pass).rust/tests/utils.rs::test_command_result_exit_code_alias— verifiesexit_code()matchescodefor success and failure (passes).$.test.mjs,pipe.test.mjs) pass with no regressions.js/src/**andrust/src/**changed).🤖 Generated with Claude Code
Resolves #36