From b45e04865df335a9aedbf2bdd5b17353c1598fa5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 4 Aug 2026 05:39:41 +0900 Subject: docs: state code facts instead of porting-phase progress Co-Authored-By: Claude Fable 5 --- crates/shirabe-class-map-generator/src/class_map_generator.rs | 4 +--- .../src/symfony/console/command/command.rs | 4 ++-- .../src/symfony/console/helper/table.rs | 4 ++-- .../src/symfony/console/style/symfony_style.rs | 4 ++-- .../src/symfony/filesystem/filesystem.rs | 4 ++-- crates/shirabe/src/console/application.rs | 10 +++++----- crates/shirabe/src/event_dispatcher/event_dispatcher.rs | 6 +++--- crates/shirabe/src/factory.rs | 4 ++-- crates/shirabe/src/package/version/version_guesser.rs | 4 ++-- crates/shirabe/src/plugin/plugin_manager.rs | 4 ---- crates/shirabe/src/repository/repository_manager.rs | 5 +++-- crates/shirabe/src/util/process_executor.rs | 4 ++-- crates/shirabe/tests/command/run_script_command_test.rs | 8 ++++---- 13 files changed, 30 insertions(+), 35 deletions(-) (limited to 'crates') diff --git a/crates/shirabe-class-map-generator/src/class_map_generator.rs b/crates/shirabe-class-map-generator/src/class_map_generator.rs index ba30d1ca..f25ea559 100644 --- a/crates/shirabe-class-map-generator/src/class_map_generator.rs +++ b/crates/shirabe-class-map-generator/src/class_map_generator.rs @@ -144,9 +144,7 @@ impl ClassMapGenerator { } } else { // $path is already an array or Traversable of SplFileInfo - todo!( - "non-string path (Traversable/array of SplFileInfo) is not yet handled in Phase A" - ) + todo!("non-string path (Traversable/array of SplFileInfo) is not handled yet") }; let cwd = realpath(&getcwd().unwrap_or_default()).unwrap_or_default(); diff --git a/crates/shirabe-external-packages/src/symfony/console/command/command.rs b/crates/shirabe-external-packages/src/symfony/console/command/command.rs index f9808878..88c1839b 100644 --- a/crates/shirabe-external-packages/src/symfony/console/command/command.rs +++ b/crates/shirabe-external-packages/src/symfony/console/command/command.rs @@ -63,8 +63,8 @@ impl CommandData { pub fn get_default_name() -> Option { // TODO(phase-c): PHP uses ReflectionClass to read the #[AsCommand] attribute // and ReflectionProperty to check that `$defaultName` is declared on the late-static - // class itself (not inherited). Reflection-based late static binding cannot be - // reproduced in Phase A; human review needed for the porting strategy. + // class itself (not inherited). Reflection-based late static binding has no direct + // Rust equivalent; human review needed for the porting strategy. todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs index 42c920f6..66ab3174 100644 --- a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs +++ b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs @@ -999,8 +999,8 @@ impl Table { } // PHP returns a TableRows wrapping a generator that lazily yields row groups. - // The generator borrows $this to call fillCells(). In Phase A we precompute the - // row groups eagerly to preserve behavior, then hand them to TableRows. + // The generator borrows $this to call fillCells(). Here the row groups are + // precomputed eagerly to preserve behavior, then handed to TableRows. let mut row_groups: Vec> = Vec::new(); for (row_key, row) in rows.into_iter().enumerate() { let row_key = row_key as i64; diff --git a/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs index 0cc7cf25..9097faff 100644 --- a/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs +++ b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs @@ -235,8 +235,8 @@ impl SymfonyStyle { .unwrap() .ask(&mut *input, self.output.clone(), question) }; - // PHP `askQuestion` returns the answer directly; exceptions propagate. Phase B - // collapses the double `Result` by panicking on either error. + // PHP `askQuestion` returns the answer directly; exceptions propagate. The double + // `Result` is collapsed here by panicking on either error. let answer = answer .expect("question helper error") .expect("missing input"); diff --git a/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs b/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs index 3759f499..071ee468 100644 --- a/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs +++ b/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs @@ -298,8 +298,8 @@ impl Filesystem { // TODO(phase-c): this only ports Symfony's readlink($path, $canonicalize = false) overload; // the $canonicalize = true branch (realpath()-based resolution, returning null if the path - // does not exist at all) is entirely unported. Per the phase B default-argument convention - // this should become a `read_link2` overload if that branch is ever needed. + // does not exist at all) is entirely unported. Following the numbered-suffix convention + // for PHP default arguments, it should become a `read_link2` overload if ever needed. fn read_link(&self, path: &str) -> String { // Symfony's readlink() with $canonicalize = false: returns null if the path is not a link. // TODO(phase-c): the Rust signature is non-Option, so the non-link case yields the path's diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs index af18cd04..e6cfad35 100644 --- a/crates/shirabe/src/console/application.rs +++ b/crates/shirabe/src/console/application.rs @@ -2391,10 +2391,10 @@ impl ApplicationHandle { // TODO(plugin): `new $dummy($script)` instantiates the // user's PHP command class in-process and registers the // live object on this Application; hosting a PHP-owned - // command here needs the PHP-side Application / command - // proxying of the plugin milestones. The shim - // class_exists above never recognizes user classes, so - // this arm is currently unreachable. + // command here needs a PHP-side Symfony Application and + // command proxying, neither of which exists yet. The + // shim class_exists above never recognizes user + // classes, so this arm is currently unreachable. let _ = shirabe_php_shim::instantiate_class( &dummy_str, vec![PhpMixed::String(script.clone())], @@ -2850,7 +2850,7 @@ impl ApplicationHandle { if Terminal::has_stty_available() { // TODO(phase-c): registers SIGINT/SIGTERM handlers that restore the stty mode via // shell_exec('stty ...'). pcntl signal handlers have no faithful Rust - // equivalent in Phase A. + // equivalent yet. let _stty_mode = shirabe_php_shim::shell_exec("stty -g"); for _signal in [shirabe_php_shim::SIGINT, shirabe_php_shim::SIGTERM] { todo!("register signal handler to restore stty mode"); diff --git a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs index 0bfdd7c7..fad6566e 100644 --- a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs +++ b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs @@ -1649,9 +1649,9 @@ try {{ /// Rust-side [`ClassLoader`]), and at most one live event handle is exposed per dispatched /// call. /// -/// TODO(plugin): this per-call scope stands in for the persistent R table of the plugin -/// activation milestone; a stub retained by the script beyond the call observes an unknown -/// handle error instead of the live object. +/// TODO(plugin): this per-call scope stands in for persistent R-table registration; a stub +/// retained by the script beyond the call observes an unknown handle error instead of the +/// live object. struct ScriptRpcDispatcher<'a> { loader: Option, event: Option<(u64, &'a dyn EventInterface)>, diff --git a/crates/shirabe/src/factory.rs b/crates/shirabe/src/factory.rs index 903f6d35..9a84117e 100644 --- a/crates/shirabe/src/factory.rs +++ b/crates/shirabe/src/factory.rs @@ -576,7 +576,7 @@ impl Factory { // initialize composer // - // Phase C: build the whole Composer graph at once with Rc::new_cyclic so that + // The whole Composer graph is built at once with Rc::new_cyclic so that // back-references (the EventDispatcher's composer, etc.) can hold a // PartialComposerWeak (Weak>). The closure cannot return a // Result, so construction errors are surfaced through `build_error`. @@ -1444,7 +1444,7 @@ impl Factory { config: &std::rc::Rc>, options: IndexMap, ) -> anyhow::Result { - // TODO(plugin): static `$warned` flag — port as a OnceCell or atomic in Phase B. + // TODO(plugin): static `$warned` flag — port as a OnceCell or atomic. static mut WARNED: bool = false; let mut disable_tls = false; // allow running the config command if disable-tls is in the arg list, even if openssl is missing, to allow disabling it via the config command diff --git a/crates/shirabe/src/package/version/version_guesser.rs b/crates/shirabe/src/package/version/version_guesser.rs index d7dc42eb..22b78a59 100644 --- a/crates/shirabe/src/package/version/version_guesser.rs +++ b/crates/shirabe/src/package/version/version_guesser.rs @@ -20,8 +20,8 @@ use shirabe_php_shim::{ }; /// Seam over the parts of [`VersionGuesser`] that consumers depend on, so they can be exercised -/// with a test double. PHP has no such interface; this exists only to allow mocking the concrete -/// `VersionGuesser` (a Phase C seam). +/// with a test double. PHP has no such interface; this exists only to allow mocking the +/// concrete `VersionGuesser`. pub trait VersionGuesserInterface: std::fmt::Debug { fn guess_version( &mut self, diff --git a/crates/shirabe/src/plugin/plugin_manager.rs b/crates/shirabe/src/plugin/plugin_manager.rs index aaee7d5a..d720bcfe 100644 --- a/crates/shirabe/src/plugin/plugin_manager.rs +++ b/crates/shirabe/src/plugin/plugin_manager.rs @@ -1,8 +1,4 @@ //! ref: composer/src/Composer/Plugin/PluginManager.php -//! -//! TODO(plugin): the entire plugin manager subsystem is part of the Plugin API -//! and is not implemented in Phase A. The structure is mirrored verbatim so -//! future plugin support can fill in the runtime hooks. use crate::composer::PartialComposerHandle; use crate::composer::{ComposerHandle, ComposerWeakHandle}; diff --git a/crates/shirabe/src/repository/repository_manager.rs b/crates/shirabe/src/repository/repository_manager.rs index ee5d2d88..5f74fc90 100644 --- a/crates/shirabe/src/repository/repository_manager.rs +++ b/crates/shirabe/src/repository/repository_manager.rs @@ -131,7 +131,8 @@ impl RepositoryManager { cleaned_config.shift_remove("exclude"); cleaned_config.shift_remove("canonical"); - // Phase B: implement dynamic class instantiation by class name + // PHP instantiates `new $class(...)` dynamically; the port matches on the known + // repository class names instead. let repository = self.create_repository_by_class(&class, cleaned_config)?; if let Some(filter_config) = filter_config { @@ -191,7 +192,7 @@ impl RepositoryManager { )?, )), other => todo!( - "Phase B: dynamic class instantiation by class name: {}", + "dynamic class instantiation is not implemented for repository class {}", other ), } diff --git a/crates/shirabe/src/util/process_executor.rs b/crates/shirabe/src/util/process_executor.rs index 7e6011cd..9e89bdd4 100644 --- a/crates/shirabe/src/util/process_executor.rs +++ b/crates/shirabe/src/util/process_executor.rs @@ -1005,7 +1005,7 @@ impl ProcessExecutor { } } -/// Phase B helper trait: convert various command argument forms into `PhpMixed`. +/// Helper trait: convert various command argument forms into `PhpMixed`. pub trait IntoExecCommand { fn into_exec_command(self) -> PhpMixed; } @@ -1187,7 +1187,7 @@ impl<'a> IntoExecOutput<'a> for Box bool> { fn write_back(&mut self, _value: String) {} } -/// Phase B helper: accept either `i64` or `PhpMixed` for `set_timeout`. +/// Helper: accept either `i64` or `PhpMixed` for `set_timeout`. pub trait ToTimeoutSeconds { fn to_timeout_seconds(self) -> i64; } diff --git a/crates/shirabe/tests/command/run_script_command_test.rs b/crates/shirabe/tests/command/run_script_command_test.rs index 74d05758..9e213cee 100644 --- a/crates/shirabe/tests/command/run_script_command_test.rs +++ b/crates/shirabe/tests/command/run_script_command_test.rs @@ -122,19 +122,19 @@ fn test_can_define_aliases() { } #[test] -#[ignore = "the test invokes the script name as a top-level composer command, which requires Application::do_run to import the user's PHP Command class (MyCommand.php) as a live application command (todo!() in application.rs; PHP-side Application milestone). The EventDispatcher-side Command-class path alone cannot satisfy the direct invocation and its argument definitions"] +#[ignore = "the test invokes the script name as a top-level composer command, which requires Application::do_run to import the user's PHP Command class (MyCommand.php) as a live application command (todo!() in application.rs; needs a PHP-side Symfony Application, which does not exist yet). The EventDispatcher-side Command-class path alone cannot satisfy the direct invocation and its argument definitions"] fn test_execution_of_simple_symfony_command() { // TODO(phase-d): the test invokes the script name as a top-level composer command, which // requires Application::do_run to import the user's PHP Command class (MyCommand.php) as a - // live application command (todo!() in application.rs; PHP-side Application milestone). + // live application command (todo!() in application.rs; needs a PHP-side Symfony Application, which does not exist yet). todo!() } #[test] -#[ignore = "the test invokes the script name as a top-level composer command, which requires Application::do_run to import the user's PHP Command class (MyCommandWithDefinitions.php) as a live application command (todo!() in application.rs; PHP-side Application milestone). The EventDispatcher-side Command-class path alone cannot satisfy the direct invocation and its argument definitions"] +#[ignore = "the test invokes the script name as a top-level composer command, which requires Application::do_run to import the user's PHP Command class (MyCommandWithDefinitions.php) as a live application command (todo!() in application.rs; needs a PHP-side Symfony Application, which does not exist yet). The EventDispatcher-side Command-class path alone cannot satisfy the direct invocation and its argument definitions"] fn test_execution_of_symfony_command_with_configuration() { // TODO(phase-d): the test invokes the script name as a top-level composer command, which // requires Application::do_run to import the user's PHP Command class (MyCommandWithDefinitions.php) - // as a live application command (todo!() in application.rs; PHP-side Application milestone). + // as a live application command (todo!() in application.rs; needs a PHP-side Symfony Application, which does not exist yet). todo!() } -- cgit v1.3.1