Skip to content

feat(ps): add --proc-path parameter to CLI and API#127

Merged
AlexandreYang merged 29 commits intomainfrom
alex/proc_path
Mar 19, 2026
Merged

feat(ps): add --proc-path parameter to CLI and API#127
AlexandreYang merged 29 commits intomainfrom
alex/proc_path

Conversation

@AlexandreYang
Copy link
Copy Markdown
Member

@AlexandreYang AlexandreYang commented Mar 18, 2026

Summary

  • Adds a --proc-path CLI flag (default: /proc) that configures the proc filesystem path used by the ps builtin
  • Adds a ProcPath(path string) RunnerOption to the interpreter API for programmatic use
  • Threads ProcPath through runnerConfigCallContextprocinfo functions on all platforms
  • Cleans up path construction in procinfo_linux.go to use proper multi-segment filepath.Join instead of fmt.Sprintf with embedded separators

Test plan

  • go test ./... passes
  • ps works as before when --proc-path is not set
  • --proc-path /custom/proc is accepted by the CLI without error

🤖 Generated with Claude Code

AlexandreYang and others added 5 commits March 18, 2026 20:35
…roc filesystem path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nstruction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ult logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexandreYang AlexandreYang marked this pull request as ready for review March 18, 2026 19:46
Copy link
Copy Markdown
Member Author

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR adds a --proc-path CLI flag and a ProcPath(path string) RunnerOption API option that lets operators redirect the ps builtin to a custom proc filesystem path (default: /proc). The change threads the new value cleanly through runnerConfigCallContext → all procinfo functions on all platforms.

Overall assessment: safe to merge with minor documentation gaps.

No security vulnerabilities introduced. The ProcPath value is set exclusively by the Go host at construction time and is immutable during script execution — a running script has no way to influence it. The direct os.* calls in procinfo_linux.go pre-existed on main and are explicitly exempt via the builtins/internal/ location.

Findings Summary

# Priority File Finding
1 P2 Badge SHELL_FEATURES.md ProcPath RunnerOption missing from docs
2 P2 Badge builtins/ps/ps_procpath_linux_test.go GetSession (default ps with no flags) not tested with fake proc path
3 P3 Badge builtins/ps/ps_procpath_linux_test.go:77 pid parameter of writeFakeProc is silently ignored (_ = pid)

Findings

P2 Badge P2 — ProcPath RunnerOption not documented

Category: Documentation
Location: SHELL_FEATURES.md (not in diff — needs separate change)

SHELL_FEATURES.md lists all RunnerOptions at lines 98–100:

- ✅ AllowedCommands — ...
- ✅ AllowAllCommands — ...
- ✅ AllowedPaths filesystem sandboxing — ...

The new ProcPath option is absent. Per AGENTS.md: "README.md and SHELL_FEATURES.md must be kept up to date with the implementation."

Remediation: Add to SHELL_FEATURES.md in the RunnerOptions section:

- ✅ ProcPath — overrides the proc filesystem path used by `ps` (default `/proc`; Linux-only; useful for testing/container environments)

P2 Badge P2 — GetSession (default ps) not covered by fake-proc tests

Category: Test Coverage
Location: builtins/ps/ps_procpath_linux_test.go

The test file covers:

  • ps -eListAll (TestProcPathFakeProc, TestProcPathFakeProcFullFormat)
  • ps -p 1GetByPIDs (TestProcPathFakeProcByPID)

But the default invocation ps (no flags) routes through GetSession, which on Linux re-reads per-PID stat files from procPath to resolve the session ID. There is no test verifying that GetSession reads from the custom procPath rather than the real /proc.

Remediation: Add a TestProcPathFakeProcSession that calls runScriptWithProcPath(t, "ps", procPath) with a fake proc and verifies it neither crashes nor reads the real /proc.


P3 Badge P3 — pid parameter of writeFakeProc is ignored

Category: Code Quality
Location: builtins/ps/ps_procpath_linux_test.go:77–104

The helper accepts a pid int parameter but always writes files under subdirectory "1" and suppresses the parameter with _ = pid. A caller passing a different value would get a misleading result.

Remediation: Either remove the pid parameter and document the hardcoded PID 1, or use it to construct the correct subdirectory and stat content.


Positive Observations

  • ProcPath is correctly placed in runnerConfig (immutable after construction) — no running script can modify it.
  • resolveProcPath is cleanly extracted into the platform-neutral procinfo.go, avoiding duplication across platform files.
  • The filepath.Join migration removes the fragile fmt.Sprintf("/proc/%d/stat", pid) pattern.
  • All four platform implementations (Linux, Darwin, Windows, other) are updated consistently.
  • The writeFakeProc test helper provides genuine isolation from /proc on the test host.
  • TestProcPathEmptyUsesDefault and TestProcPathNonexistentDirErrors cover the two most important boundary cases.

Comment thread builtins/ps/ps_procpath_linux_test.go Outdated
Comment thread builtins/ps/ps_procpath_linux_test.go
@AlexandreYang
Copy link
Copy Markdown
Member Author

@codex review this PR

Important: Read the SPECS section of the PR description. If SPECS are present: make sure the implementation matches ALL the specs.
The specs override other instructions (code, inline comments in code, etc). ALL specs MUST be implemented.

@AlexandreYang
Copy link
Copy Markdown
Member Author

Iteration 1 self-review result: COMMENT — 3 findings (2×P2, 1×P3)

Summary:

  • P2: ProcPath RunnerOption missing from SHELL_FEATURES.md docs
  • P2: GetSession (bare ps) not tested with fake proc path
  • P3: writeFakeProc silently ignores the pid parameter (always writes to dir "1")

No P0/P1 blockers. Safe to merge with minor doc and test gaps fixed.

Comment thread builtins/internal/procinfo/procinfo.go
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb9b7c8dd7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread builtins/internal/procinfo/procinfo_linux.go
…roc, add session test, update docs

- Introduce builtins.ProcProvider (proc_provider.go): wraps procinfo path in
  an opaque struct so callers cannot override the configured proc path.
  Addresses thieman's concern that passing procPath as a plain string param
  allowed any builtin to bypass the sandbox-configured path.
- Replace CallContext.ProcPath string with CallContext.Proc *ProcProvider;
  update runner_exec.go to construct ProcProvider from r.procPath.
- Update ps.go to call callCtx.Proc.ListAll/GetSession/GetByPIDs instead of
  passing procPath directly to procinfo functions.
- Fix writeFakeProc to use the pid parameter instead of always writing to
  directory "1" (P3 self-comment).
- Add TestProcPathFakeProcSession to cover the bare ps → GetSession code
  path with a fake proc directory (P2 self-comment).
- Add ProcPath to SHELL_FEATURES.md RunnerOptions section (P2 review body).
- Add path/filepath.Join and strconv.Itoa to allowedsymbols allowlists for
  the procinfo package; these were used in procinfo_linux.go but missing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AlexandreYang
Copy link
Copy Markdown
Member Author

[Claude Sonnet 4.6] Addressed review feedback from @AlexandreYang:

  • P2 (SHELL_FEATURES.md): Added ProcPath to the RunnerOptions section.
  • P2 (GetSession not tested): Added TestProcPathFakeProcSession that verifies bare ps (→ GetSession) runs without crash against a fake proc tree.
  • P3 (pid param ignored in writeFakeProc): Fixed to use the pid parameter for the subdirectory name and stat content.
  • Also addressed thieman's reviewer comment: introduced builtins.ProcProvider to make the proc path opaque and non-overridable by call sites.
  • Fixed pre-existing allowedsymbols failures: added path/filepath.Join and strconv.Itoa to the procinfo allowlists.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d09c26bcb0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread builtins/internal/procinfo/procinfo_linux.go Outdated
Comment thread builtins/internal/procinfo/procinfo.go
Add a base-path accessibility check at the start of getByPIDs so that
a bad --proc-path is reported as an error by ps -p, consistent with
how ps -e already fails via os.ReadDir in listAll. Also add a test
TestProcPathNonexistentDirErrorsByPID covering this path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread builtins/internal/procinfo/procinfo.go
@AlexandreYang
Copy link
Copy Markdown
Member Author

@codex review this PR

Important: Read the SPECS section of the PR description. If SPECS are present: make sure the implementation matches ALL the specs.
The specs override other instructions (code, inline comments in code, etc). ALL specs MUST be implemented.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a789762c07

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread builtins/internal/procinfo/procinfo_linux.go Outdated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexandreYang
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown
Member Author

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Reviewed PR #127feat(ps): add --proc-path parameter to CLI and API.

The overall design is solid: ProcProvider cleanly abstracts the fixed proc path, the public API (ProcPath option) is well-documented, platform stubs ignore the arg correctly, and subshell inheritance works automatically since procPath is in runnerConfig (value-copied). Test coverage for the new API is good.

Assessment: needs fixes — one P1 CI break, one P3 nit.

# Priority File Finding
1 P1 Badge builtins/internal/procinfo/procinfo_linux.go:109 os.Stat not in allowed-symbols allowlist — CI failing
2 P3 Badge interp/runner_exec.go:313 NewProcProvider allocated on every builtin call

Test coverage

Code path Test Status
getByPIDs valid path TestProcPathFakeProcByPID Covered
getByPIDs nonexistent path TestProcPathNonexistentDirErrorsByPID Covered
listAll valid path TestProcPathFakeProc Covered
listAll nonexistent path TestProcPathNonexistentDirErrors Covered
getSession valid path TestProcPathFakeProcSession Covered
ProcPath("") defaults to /proc TestProcPathEmptyUsesDefault Covered
CLI --proc-path flag TestProcPathFlagNonexistentDir Covered
--proc-path in --help output TestProcPathFlagInHelp Covered

Comment thread builtins/internal/procinfo/procinfo_linux.go Outdated
Comment thread interp/runner_exec.go Outdated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aff70bb0fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread builtins/internal/procinfo/procinfo_linux.go Outdated
@AlexandreYang
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e73d031cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread builtins/internal/procinfo/procinfo_linux.go Outdated
Comment thread .claude/skills/review-fix-loop/SKILL.md Outdated
@AlexandreYang
Copy link
Copy Markdown
Member Author

Self-review (iteration 1)

Result: COMMENT
Findings: 2×P3

  • P3-1: listAll inconsistent error guard vs getByPIDs (builtins/internal/procinfo/procinfo_linux.go:26)
  • P3-2: Custom require helper in ps_procpath_linux_test.go inconsistent with testify used elsewhere

@AlexandreYang
Copy link
Copy Markdown
Member Author

Codex review (iteration 1)

Findings: 1×P1, 3×P2

P1.claude/skills/review-fix-loop/SKILL.md: After removing address-pr-comments, the loop has no step that gathers or resolves actual PR review threads. Step 3 still treats unresolved threads as a hard failure, so on a PR with human comments the loop spins to the iteration limit.

P2.claude/skills/review-fix-loop/SKILL.md:112: The codex review command asks Codex to validate PR description SPECS, but the diff isn't enriched with the PR description body, so specs can't be validated. (Note: SPECS were intentionally removed from code-review as a prompt injection fix.)

P2cmd/rshell/main.go:112, builtins/internal/procinfo/procinfo_linux.go: ProcPath bypasses AllowedPaths sandboxing — ps uses raw os.ReadDir/os.ReadFile/os.Stat on the configured path. This is likely intentional (privileged config), but README still says AllowedPaths restricts all file operations. Needs doc clarification.

P2builtins/internal/procinfo/procinfo_linux.go:69,84: Bare ps with a custom proc path is incomplete — session selection still uses the real os.Getpid() to look up the PID in the overridden proc tree, which fails in container/testing environments. The new test explicitly avoids asserting correct output for this mode.

AlexandreYang and others added 5 commits March 18, 2026 23:07
…use testify in ps test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…x review comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… in review-fix-loop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Reviewed: feat(ps): add --proc-path parameter to CLI and API

Overall assessment: safe to merge. This PR introduces a --proc-path CLI flag and ProcPath RunnerOption to override the proc filesystem root used by the ps builtin. The design is clean and the implementation is correct.

Security

  • ProcPath is operator-controlled only. The path is fixed at New() time and stored in runnerConfig — scripts cannot influence it. This is explicitly documented in README.md.
  • No path injection via PID components. All sub-paths under procPath are constructed with filepath.Join(procPath, strconv.Itoa(pid), filename) where pid is always a validated positive integer (from os.ReadDir directory names or parsePIDs). No injection vector.
  • Sandbox bypass is intentional and documented. procinfo directly uses os.ReadFile/os.ReadDir (bypassing AllowedPaths), which is appropriate for a virtual read-only filesystem. This is already permitted by the allowedsymbols allowlist and clearly documented in README.md.
  • getByPIDs Stat guard is correctly placed. Without the upfront os.Stat check, a nonexistent procPath would silently produce empty results (because readProc's ErrNotExist return is silently skipped as "process no longer exists"). The guard prevents this silent failure.

Correctness

  • The ProcProvider wrapper correctly fixes the path at construction time, preventing any override by script-level callers.
  • NewProcProvider and resolveProcPath both normalize empty string → DefaultProcPath. This double-normalization is redundant but not incorrect.
  • Subshells inherit proc via runnerConfig value copy — correct, since ProcProvider is immutable after construction.

Test Coverage

Code path Scenario test Go test Status
listAll with nonexistent procPath (ps -e) TestProcPathNonexistentDirErrors Covered
getByPIDs with nonexistent procPath (ps -p) TestProcPathNonexistentDirErrorsByPID Covered
listAll with file (not dir) as procPath TestProcPathNotADirErrors_ListAll Covered
getByPIDs with file (not dir) as procPath TestProcPathNotADirErrors_ByPID Covered
Empty ProcPath falls back to /proc TestProcPathEmptyUsesDefault Covered
listAll with fake proc tree (ps -e) TestProcPathFakeProc Covered
getByPIDs with fake proc tree (ps -p) TestProcPathFakeProcByPID Covered
getSession with fake proc tree (bare ps) TestProcPathFakeProcSession Covered
getSession with nonexistent procPath (bare ps) Missing (P3)
CLI --proc-path flag nonexistent dir TestProcPathFlagNonexistentDir Covered
CLI --proc-path flag with fake proc tree TestProcPathFlagFakeProc Covered
--proc-path appears in --help output TestProcPathFlagInHelp Covered

Positive Observations

  • Excellent use of the ProcProvider wrapper to enforce immutability — the path cannot be changed after New(), and scripts have zero influence over it.
  • The allowedsymbols allowlist additions (os.Stat, path/filepath.Join, strconv.Itoa) are minimal and correctly justified.
  • Consistent use of filepath.Join throughout procinfo_linux.go replaces error-prone fmt.Sprintf with embedded / separators.
  • Documentation is updated in both README.md and SHELL_FEATURES.md.

Findings

# Priority File Finding
1 P3 Badge interp/api.go:493 ProcPath godoc missing Linux-only effectiveness note
2 P3 Badge builtins/internal/procinfo/procinfo_linux.go:131 Error message uses %s/%d string format instead of filepath.Join
3 P3 Badge builtins/ps/ps_procpath_linux_test.go Missing test: bare ps (GetSession) with nonexistent procPath

Comment thread interp/api.go Outdated
Comment thread builtins/internal/procinfo/procinfo_linux.go Outdated
Comment thread builtins/ps/ps_procpath_linux_test.go
@AlexandreYang
Copy link
Copy Markdown
Member Author

Self-review (iteration 2)

Findings: 3×P3

P3 — interp/api.go:493: ProcPath godoc missing note that it is Linux-only
P3 — builtins/internal/procinfo/procinfo_linux.go:131: error message uses %s/%d instead of filepath.Join
P3 — builtins/ps/ps_procpath_linux_test.go: missing test for bare ps with nonexistent procPath

@AlexandreYang
Copy link
Copy Markdown
Member Author

Codex review (iteration 2)

Findings: 2×P1, 1×P2

P1 — cmd/rshell/main.go:112, procinfo_linux.go:27,140,242,261: --proc-path reads outside AllowedPaths. Accepted design: flag is privileged operator config set at construction time by trusted code; scripts cannot influence it; documented in README as intentional AllowedPaths carve-out.

P1 — review-fix-loop/SKILL.md:102,286,314: self-review posts GitHub threads but loop has no mechanism to resolve them; Step 3 requires zero unresolved threads → loop can't converge. Will fix: remove the unresolved-threads gate from Step 3.

P2 — code-review/SKILL.md:29, review-fix-loop/SKILL.md:110: SPECS section removed. Intentional: removed as prompt injection security fix; not restoring.

AlexandreYang and others added 2 commits March 18, 2026 23:36
…te review-fix-loop to use RULES.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gate from review-fix-loop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2fc858ac3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/skills/review-fix-loop/SKILL.md Outdated
Comment thread .claude/skills/code-review/SKILL.md
AlexandreYang and others added 3 commits March 18, 2026 23:39
…eview

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexandreYang
Copy link
Copy Markdown
Member Author

@codex review

@AlexandreYang
Copy link
Copy Markdown
Member Author

Self-review (iteration 1/1)

Findings: 1×P2

P2 — builtins/ps/ps_procpath_linux_test.go: TestProcPathFakeProcSession comment says "must not read the real /proc" but the output is not asserted to verify this. The test only checks exit code 0; it should also assert the output is small (just the header line) since no real-proc PIDs are in the fake tree.

@AlexandreYang
Copy link
Copy Markdown
Member Author

Codex review (iteration 1/1)

Findings: 1×P1 (disputed), 1×P2

P1 (disputed) — cmd/rshell/main.go:112, interp/api.go:492: Codex flags that --proc-path CLI flag feeds into unsandboxed os.ReadDir/os.ReadFile calls bypassing AllowedPaths. This is intentional by design — --proc-path is a privileged option set by the trusted host invoking rshell, not by shell scripts running inside it. The README explicitly documents this: "This is a privileged option set at runner construction time by trusted caller code — scripts cannot influence it." Not treating as a P1.

P2 — builtins/internal/procinfo/procinfo_linux.go:70,85: bare ps (session mode) uses host os.Getpid() to walk the PPID chain inside the alternate procfs. If the alternate procfs is from a different PID namespace, our PID won't be present and bare ps returns empty results. This is expected for the current use case (testing) but warrants a comment in getSession and the ProcPath option docs.

…ID-namespace caveat

- Add line-count assertion to TestProcPathFakeProcSession to verify the
  real /proc is not read (only the header line should appear).
- Add comment to getSession on Linux explaining that bare ps returns empty
  results when procPath is from a foreign PID namespace.
- Extend ProcPath godoc to document the same PID-namespace caveat.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AlexandreYang
Copy link
Copy Markdown
Member Author

Review-Fix Loop Summary

Iteration log

# Review result Findings Fixes applied CI status
1 COMMENT 1×P2 (self), 1×P1-disputed + 1×P2 (codex) 2 fixed Passing

Final state

  • Self-review: APPROVE (no remaining findings)
  • Local codex review: Clean (P1 was disputed as by-design; P2 addressed)
  • CI: Passing (31/31 checks green)

Fixes applied (iter 1)

  1. TestProcPathFakeProcSession output assertion — added strings.Count(stdout, "\n") <= 1 check to verify the real /proc is not read (only the header line should appear when the fake proc has no matching PIDs in our session).
  2. PID-namespace caveat documented — added comment to getSession on Linux and extended ProcPath godoc explaining that bare ps returns empty session results when procPath is from a foreign PID namespace.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95acdeec6c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread builtins/ps/ps.go
@@ -1,336 +0,0 @@
---
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Removing skills/instructions related to using PR comment. This is a public repo and it's likely not very safe to rely on PR comments since it could be a prompt injection attack vector.

@AlexandreYang AlexandreYang added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 4453c49 Mar 19, 2026
31 checks passed
@AlexandreYang AlexandreYang deleted the alex/proc_path branch March 19, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants