You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Sun-GLiang (via GitHub)" <gi...@apache.org> on 2026/09/12 06:41:46 UTC
[I] runtime-host project add with a regular file inside a Git repository shuts down the Host [maka]
Sun-GLiang opened a new issue, #5220:
URL: https://github.com/apache/maka/issues/5220
### What happened
`maka runtime-host project add` does not validate that the supplied path is a directory. Passing a regular file inside a Git repository returns `Project catalog mutation outcome is unknown` and makes the Runtime Host exit with code 1. The next `project list` cannot connect to the Host. A mistyped project path should be rejected as invalid input while the Host stays available.
There is a second branch of the same missing validation: a regular file outside any Git repository is successfully added as an unavailable project (`available: false`, exit code 0), instead of being rejected.
### How to reproduce
1. Build main (`npm ci`, `npm run build`). Create an isolated directory containing a Git repository, an ordinary file, and a separate Host state directory:
```sh
repro_dir="$(mktemp -d)"
git init --quiet "$repro_dir/repo"
touch "$repro_dir/repo/README.md"
mkdir "$repro_dir/state"
```
2. Start a Host and wait for the `runtime_host_ready` JSON event (keep this terminal open; substitute the printed absolute path for `$repro_dir` in the second terminal):
```sh
node packages/cli/dist/cli.js runtime-host serve \
--root "$repro_dir/state" --no-project-roots --json
```
3. In a second terminal, first confirm that the Host is available, then add the **file**, then query again:
```sh
node packages/cli/dist/cli.js runtime-host project list --root "$repro_dir/state"
node packages/cli/dist/cli.js runtime-host project add "$repro_dir/repo/README.md" --root "$repro_dir/state"
node packages/cli/dist/cli.js runtime-host project list --root "$repro_dir/state"
```
4. The first query returns `[]`. The add command exits 1 with `Project catalog mutation outcome is unknown`; the Host exits 1; the final query exits 1 with `Runtime Host service is not available (unavailable)`.
Reproduced in three isolated Host instances. For the non-Git variant, use a plain directory instead of `git init`: the add command returns a project with name `README.md`, `available: false`, and exit code 0.
### Environment
- Maka: built locally from main, `05164f5359467a9d00ea144395ab0b9f1f74750c` (package version 0.2.0)
- OS: macOS 15.6 (24G84), arm64
- Surface: CLI / Runtime Host
- Node.js: v24.19.0
- Tested: September 12, 2026
### Logs, screenshots, or additional context
```text
Before:
project list: exit 0, []
Trigger:
RuntimeHostOperationError: Project catalog mutation outcome is unknown
project add: exit 1
Host process:
exit code 1, no signal
After:
Error: Runtime Host service is not available (unavailable)
project list: exit 1
```
The resolver calls `realpath()` but does not check `stat().isDirectory()` before repository discovery (`packages/storage/src/project-catalog.ts`, `resolveProjectLocation`). Within a Git repository it executes `git -C <regular-file> rev-parse ...`; this fails with Git's numeric exit status, which is not one of the filesystem codes recognized by `isInvalidPathError`. The coordinator consequently calls `requestDrain()` and reports `commit_outcome_unknown` (`packages/runtime-host/src/server/project-catalog-coordinator.ts:143-149`). Outside Git, the same file passes through as a folder project.
Related but different: #4806 concerns a valid directory below an invalid ancestor `.git` marker. This reproduction uses a valid Git repository and selects a regular file; the missing path-type check is also visible without Git.
Discovered and reproduced by Codex during user-authorized exploratory testing of a locally built main checkout. All fixtures and Host roots were isolated from the user's existing Maka data. The testing launcher only selected a separate profile name; the CLI commands and Host implementation were unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [I] runtime-host project add with a regular file inside a Git repository shuts down the Host [maka]
Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks closed issue #5220: runtime-host project add with a regular file inside a Git repository shuts down the Host
URL: https://github.com/apache/maka/issues/5220
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org