aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-02 16:27:36 +0900
committernsfisis <nsfisis@gmail.com>2026-08-02 16:29:08 +0900
commit9efc866ae2553a9c51abae7214f62dde4f5f053c (patch)
treed3749ced8b4e32713d4f5e3e88a34b501c4b4918 /crates/shirabe/src
parent6047bcc3e63ab84dfc67bce94f402f1bfa3f58d5 (diff)
downloadphp-shirabe-9efc866ae2553a9c51abae7214f62dde4f5f053c.tar.gz
php-shirabe-9efc866ae2553a9c51abae7214f62dde4f5f053c.tar.zst
php-shirabe-9efc866ae2553a9c51abae7214f62dde4f5f053c.zip
chore(todo): consolidate TODO comments into the five fixed marker tags
Retag every Shirabe-authored TODO comment to one of the fixed tags: phase-c, phase-d, plugin, php-runtime, phase-e. Upstream-authored TODO comments from Composer/Symfony are left untouched to preserve the ported code shape. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src')
-rw-r--r--crates/shirabe/src/composer.rs2
-rw-r--r--crates/shirabe/src/console/application.rs18
-rw-r--r--crates/shirabe/src/installer/installation_manager.rs8
-rw-r--r--crates/shirabe/src/json/json_file.rs2
-rw-r--r--crates/shirabe/src/repository/composer_repository.rs4
-rw-r--r--crates/shirabe/src/util/auth_helper.rs1
-rw-r--r--crates/shirabe/src/util/http/curl_downloader.rs8
-rw-r--r--crates/shirabe/src/util/loop.rs4
8 files changed, 23 insertions, 24 deletions
diff --git a/crates/shirabe/src/composer.rs b/crates/shirabe/src/composer.rs
index a0a8f248..356aefc1 100644
--- a/crates/shirabe/src/composer.rs
+++ b/crates/shirabe/src/composer.rs
@@ -14,7 +14,7 @@ use crate::util::r#loop::Loop;
use shirabe_external_packages::composer::pcre::Preg;
use shirabe_php_shim::php_regex;
-// TODO: change this information to Shirabe version.
+// TODO(phase-c): change this information to Shirabe version.
pub const VERSION: &str = "2.9.7";
pub const BRANCH_ALIAS_VERSION: &str = "";
pub const RELEASE_DATE: &str = "2026-04-14 13:31:52";
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 8b1cbe60..56718164 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -164,7 +164,7 @@ impl Application {
let io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>> =
std::rc::Rc::new(std::cell::RefCell::new(NullIO::new()));
- // TODO(phase-d): Composer registers shutdown function that reports special message for
+ // TODO(php-runtime): Composer registers shutdown function that reports special message for
// OOM. In Shirabe, limit of memory allocation has effect only on PHP side so that the
// corresponding shutdown function should be registered in PHP runtime, not here.
// if (!$shutdownRegistered) { ... }
@@ -1264,7 +1264,7 @@ impl Application {
// PHP rewrites `@anonymous\0` markers via class_exists/get_parent_class/class_implements.
// Rust error messages never carry PHP's anonymous-class marker and those reflection
// primitives have no Rust equivalent, so the branch is unreachable here.
- // TODO(review): port the @anonymous rewrite if it ever becomes relevant.
+ // TODO(phase-c): port the @anonymous rewrite if it ever becomes relevant.
let width = if self.terminal.get_width() != 0 {
self.terminal.get_width() - 1
@@ -1290,7 +1290,7 @@ impl Application {
if !throwable_is_exception_interface(e)
|| output_interface::VERBOSITY_VERBOSE <= verbosity
{
- // TODO(review): anyhow::Error carries no PHP file/line, so getFile()/getLine() take
+ // TODO(phase-c): anyhow::Error carries no PHP file/line, so getFile()/getLine() take
// the 'n/a' fallback PHP itself uses when they are unavailable. The real source
// location cannot be reproduced (it would be a Rust path, not Composer's PHP path).
messages.push(format!(
@@ -2520,7 +2520,7 @@ impl ApplicationHandle {
if e.downcast_ref::<TransportException>().is_some() {
// PHP: ReflectionProperty $reflProp = new \ReflectionProperty($e, 'code');
// $reflProp->setValue($e, Installer::ERROR_TRANSPORT_EXCEPTION);
- // TODO: reflection-based mutation of the existing exception is not portable;
+ // TODO(phase-c): reflection-based mutation of the existing exception is not portable;
// we surface the rewritten code via a fresh TransportException at the call site.
let _ = Installer::ERROR_TRANSPORT_EXCEPTION;
}
@@ -2590,7 +2590,7 @@ impl ApplicationHandle {
Some(output) => output,
};
- // TODO: PHP installs a temporary `set_exception_handler($renderException)` and cooperates
+ // TODO(php-runtime): PHP installs a temporary `set_exception_handler($renderException)` and cooperates
// with Symfony's ErrorHandler to keep/restore it. PHP's process-global exception handler
// stack has no Rust equivalent; the rendering itself is invoked directly in the catch
// branch below. Review needed for the handler save/restore dance.
@@ -2636,7 +2636,7 @@ impl ApplicationHandle {
// $exitCode = $e->getCode();
// is_numeric($exitCode) ? max(1, (int) $exitCode) : 1
- // TODO(review): anyhow::Error has no PHP-style getCode(); the exit code derived
+ // TODO(phase-c): anyhow::Error has no PHP-style getCode(); the exit code derived
// from the exception's `code` field needs the downcast strategy decided.
let exit_code = shirabe_php_shim::php_exception_get_code(&e);
if shirabe_php_shim::is_numeric_string(&exit_code.to_string()) {
@@ -2846,7 +2846,7 @@ impl ApplicationHandle {
if !application.borrow().signals_to_dispatch_event.is_empty() {
// $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []
- // TODO(review): SymfonyCommand is not a SignalableCommandInterface here; downcast needed.
+ // TODO(phase-c): SymfonyCommand is not a SignalableCommandInterface here; downcast needed.
let command_signals: Vec<i64> = Vec::new();
let _ = std::marker::PhantomData::<dyn SignalableCommandInterface>;
@@ -2860,7 +2860,7 @@ impl ApplicationHandle {
}
if Terminal::has_stty_available() {
- // TODO: registers SIGINT/SIGTERM handlers that restore the stty mode via
+ // 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.
let _stty_mode = shirabe_php_shim::shell_exec("stty -g");
@@ -3005,7 +3005,7 @@ fn throwable_get_code(e: &(dyn std::error::Error + 'static)) -> i64 {
/// PHP's `get_debug_type($e)` for the title line, reached only when the message is empty or output
/// is verbose. PHP returns the exception's fully-qualified class name; Rust has no runtime FQCN, so
/// this maps the enumerable exception types to their PHP class names and falls back to `Exception`.
-/// TODO(review): the fully-qualified name (e.g. `Composer\...`) cannot be reproduced faithfully.
+/// TODO(phase-c): the fully-qualified name (e.g. `Composer\...`) cannot be reproduced faithfully.
fn throwable_debug_type(e: &(dyn std::error::Error + 'static)) -> String {
let name = if e
.downcast_ref::<shirabe_php_shim::RuntimeException>()
diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs
index 3a04a8e9..cf75469c 100644
--- a/crates/shirabe/src/installer/installation_manager.rs
+++ b/crates/shirabe/src/installer/installation_manager.rs
@@ -308,9 +308,9 @@ impl InstallationManager {
SignalHandler::SIGTERM.to_string(),
SignalHandler::SIGHUP.to_string(),
],
- // TODO(phase-b): closure captures &mut self via &mut cleanup_promises
+ // TODO(phase-c): closure captures &mut self via &mut cleanup_promises
Box::new(move |signal: String, handler: &SignalHandler| {
- // TODO(phase-b): self.io.write_error(...); self.run_cleanup(&cleanup_promises);
+ // TODO(phase-c): self.io.write_error(...); self.run_cleanup(&cleanup_promises);
let _ = signal;
handler.exit_with_last_signal();
}),
@@ -802,7 +802,7 @@ impl InstallationManager {
return;
}
- // TODO(phase-c-promise): PHP collects every http_downloader.add() promise and runs them via
+ // TODO(phase-c): PHP collects every http_downloader.add() promise and runs them via
// Loop::wait; the single-threaded sync bridge block_on's each notification serially instead.
let result: anyhow::Result<()> = (|| -> anyhow::Result<()> {
for (repo_url, packages) in self.notifiable_packages.borrow().iter() {
@@ -929,7 +929,7 @@ impl InstallationManager {
/// PHP: waitOnPromises() creates a ProgressBar up front and Loop::wait advances it while the
/// concurrent promises resolve.
- /// TODO(phase-c-promise): Loop::wait has no active-job counter to feed the bar yet, so a
+ /// TODO(phase-c): Loop::wait has no active-job counter to feed the bar yet, so a
/// single 0% -> 100% jump is rendered after the wait instead of PHP's timing-driven
/// intermediate snapshots.
async fn wait_on_promises<'p>(
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs
index dbcd7a19..cba11f01 100644
--- a/crates/shirabe/src/json/json_file.rs
+++ b/crates/shirabe/src/json/json_file.rs
@@ -534,7 +534,7 @@ impl JsonFile {
/// @throws ParsingException
/// @return bool true on success
pub(crate) fn validate_syntax(json: &str, file: Option<&str>) -> anyhow::Result<bool> {
- // TODO(phase-d): make json_decode() returns an error object with details.
+ // TODO(phase-c): make json_decode() returns an error object with details.
let error = match serde_json::from_str::<serde_json::Value>(json) {
Ok(_) => {
// TODO(phase-c): Rust's &str is guaranteed as UTF-8, but PHP string is not. Change `json`
diff --git a/crates/shirabe/src/repository/composer_repository.rs b/crates/shirabe/src/repository/composer_repository.rs
index ba68d22c..015a278e 100644
--- a/crates/shirabe/src/repository/composer_repository.rs
+++ b/crates/shirabe/src/repository/composer_repository.rs
@@ -982,7 +982,7 @@ impl ComposerRepository {
// then does a single `$this->loop->wait($promises)`; mirror that here by polling all
// downloads concurrently via FuturesOrdered (submission order preserved) before doing
// any of the per-name response processing below.
- // TODO(phase-c-promise): the fan-out below is structurally concurrent, but each
+ // TODO(phase-c): the fan-out below is structurally concurrent, but each
// `start_cached_async_download` future still resolves through `HttpDownloader::add`'s
// `curl_runtime()`/`sync_executor::block_on` bridge, so real I/O overlap does not happen
// yet (see util/loop.rs::wait). That only changes once a single top-level Runtime
@@ -1770,7 +1770,7 @@ impl ComposerRepository {
// does a single `$this->loop->wait($promises)`; mirror that here by polling all downloads
// concurrently via FuturesOrdered (submission order preserved) before doing any of the
// per-name response processing below.
- // TODO(phase-c-promise): the fan-out below is structurally concurrent, but each
+ // TODO(phase-c): the fan-out below is structurally concurrent, but each
// `start_cached_async_download` future still resolves through `HttpDownloader::add`'s
// `curl_runtime()`/`sync_executor::block_on` bridge, so real I/O overlap does not happen yet
// (see util/loop.rs::wait). That only changes once a single top-level Runtime replaces those
diff --git a/crates/shirabe/src/util/auth_helper.rs b/crates/shirabe/src/util/auth_helper.rs
index 8a621eb1..2131a107 100644
--- a/crates/shirabe/src/util/auth_helper.rs
+++ b/crates/shirabe/src/util/auth_helper.rs
@@ -496,7 +496,6 @@ impl AuthHelper {
username,
)));
} else if password == "custom-headers" {
- // TODO:
// Handle custom HTTP headers from auth.json
#[allow(unused_assignments)]
let mut custom_headers: PhpMixed = PhpMixed::Null;
diff --git a/crates/shirabe/src/util/http/curl_downloader.rs b/crates/shirabe/src/util/http/curl_downloader.rs
index 3b65b0f6..89e9661e 100644
--- a/crates/shirabe/src/util/http/curl_downloader.rs
+++ b/crates/shirabe/src/util/http/curl_downloader.rs
@@ -76,9 +76,9 @@ impl CurlDownloader {
// - cookie_store(true) ~ CURL_LOCK_DATA_COOKIE
// - redirect(none) ~ CURLOPT_FOLLOWLOCATION = false (we follow manually)
// The libcurl version-specific multiplexing / accept-encoding workarounds are not needed.
- // TODO: a brand-new reqwest client is created per CurlDownloader; that is acceptable here
+ // TODO(phase-e): a brand-new reqwest client is created per CurlDownloader; that is acceptable here
// (one HttpDownloader owns one CurlDownloader) but not pooled across them.
- // TODO: cookie sharing (CURL_LOCK_DATA_COOKIE) would need reqwest's `cookies` feature
+ // TODO(phase-c): cookie sharing (CURL_LOCK_DATA_COOKIE) would need reqwest's `cookies` feature
// (.cookie_store(true)); omitted as it is not required for package downloads.
let client = reqwest::Client::builder()
.pool_max_idle_per_host(8)
@@ -507,10 +507,10 @@ impl CurlDownloader {
.and_then(|v| v.as_int())
.map(|n| n as u64);
- // TODO: per-request ssl (cafile/verify_peer/local_cert) and proxy settings are reqwest
+ // TODO(phase-c): per-request ssl (cafile/verify_peer/local_cert) and proxy settings are reqwest
// Client-level, not request-level. They are not applied here yet; a ConnectionOptions-keyed
// Client cache (as in the design sketch) is required to honor them.
- // TODO: CURLOPT_IPRESOLVE (force IPv4/IPv6) has no direct reqwest API.
+ // TODO(phase-c): CURLOPT_IPRESOLVE (force IPv4/IPv6) has no direct reqwest API.
let _ = attributes;
let reqwest_method =
diff --git a/crates/shirabe/src/util/loop.rs b/crates/shirabe/src/util/loop.rs
index c2fa3b08..f94788ac 100644
--- a/crates/shirabe/src/util/loop.rs
+++ b/crates/shirabe/src/util/loop.rs
@@ -49,7 +49,7 @@ impl Loop {
let mut pending: FuturesUnordered<_> = promises.into_iter().collect();
let mut uncaught: Option<anyhow::Error> = None;
- // TODO(phase-c-promise): promises are now polled concurrently via FuturesUnordered, but
+ // TODO(phase-c): promises are now polled concurrently via FuturesUnordered, but
// each individual future (HttpDownloader::add/add_copy etc.) still resolves through a
// blocking bridge (curl_runtime()/sync_executor::block_on), so real I/O overlap does not
// happen yet — the bridged future fully blocks the thread until it settles before the next
@@ -67,7 +67,7 @@ impl Loop {
}
pub fn abort_jobs(&self) {
- // TODO(phase-c-promise): no-op until a cancellation mechanism is introduced. PHP cancels
+ // TODO(phase-c): no-op until a cancellation mechanism is introduced. PHP cancels
// every in-flight promise group it tracks in $currentPromises; reintroduce that tracking
// once the asynchronous workers support cancellation on a multi-thread runtime.
}