feat: Major documentation reorganization and unified Box design updates

## Documentation & Organization
- Moved copilot_issues.txt → 00_MASTER_ROADMAP.md (phases folder)
- Created Phase 9.79b.1 & 9.79b.2 plans for unified Box implementation
- Updated unified-box-design-deep-analysis.md with ChatGPT5 insights
- Added P2P documentation and examples (ping-pong, self-ping)

## Code Updates
- P2PBox: Reverted to original error state for demonstration
- VM: Enhanced BoxCall dispatch for unified approach
- Updated box factory, interpreter calls, and transport layer

## Cleanup & Privacy
- Removed private/ and private_test/ from git tracking
- Added private folders to .gitignore for security
- Cleaned root directory: moved backups, removed temp files
- Moved consultation files to docs/archive/consultations/

## Other Improvements
- Added object literal syntax improvement idea
- Updated CLAUDE.md with master roadmap reference
- Updated CURRENT_TASK.md with latest progress

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-26 20:30:07 +09:00
parent 22212aa314
commit 6eda81f5db
41 changed files with 1446 additions and 3132 deletions

View File

@ -229,6 +229,38 @@ impl NyashInterpreter {
// オブジェクトを評価(通常のメソッド呼び出し)
let obj_value = self.execute_expression(object)?;
idebug!("🔍 DEBUG: execute_method_call - object type: {}, method: {}", obj_value.type_name(), method);
// 🌟 ユニバーサルメソッド前段ディスパッチ(非侵襲)
// toString()/type()/equals(x)/clone() をトレイトに直結
match method {
"toString" => {
if !arguments.is_empty() {
return Err(RuntimeError::InvalidOperation { message: format!("toString() expects 0 arguments, got {}", arguments.len()) });
}
return Ok(Box::new(obj_value.to_string_box()));
}
"type" => {
if !arguments.is_empty() {
return Err(RuntimeError::InvalidOperation { message: format!("type() expects 0 arguments, got {}", arguments.len()) });
}
return Ok(Box::new(StringBox::new(obj_value.type_name())));
}
"equals" => {
if arguments.len() != 1 {
return Err(RuntimeError::InvalidOperation { message: format!("equals() expects 1 argument, got {}", arguments.len()) });
}
let rhs = self.execute_expression(&arguments[0])?;
let eq = obj_value.equals(&*rhs);
return Ok(Box::new(eq));
}
"clone" => {
if !arguments.is_empty() {
return Err(RuntimeError::InvalidOperation { message: format!("clone() expects 0 arguments, got {}", arguments.len()) });
}
return Ok(obj_value.clone_box());
}
_ => {}
}
// Builtin dispatch (centralized)
if let Some(res) = self.dispatch_builtin_method(&obj_value, method, arguments) {

View File

@ -47,6 +47,9 @@ impl NyashInterpreter {
method: &str,
arguments: &[ASTNode],
) -> Result<Box<dyn NyashBox>, RuntimeError> {
if crate::interpreter::utils::debug_on() || std::env::var("NYASH_DEBUG_P2P").unwrap_or_default() == "1" {
eprintln!("[Interp:P2P] {}(..) called with {} args", method, arguments.len());
}
match method {
// ードID取得
"getNodeId" | "getId" => Ok(p2p_box.get_node_id()),
@ -74,7 +77,7 @@ impl NyashInterpreter {
}
// on メソッド実装ResultBox返却
, "on" => {
"on" => {
if arguments.len() < 2 {
return Err(RuntimeError::InvalidOperation { message: "on requires (intentName, handler) arguments".to_string() });
}