Skip to content

fix(admission): a busy process outside any repository is host load, not unknown ownership - #295

Merged
entelecheia merged 6 commits into
mainfrom
fix/294-admit-cpu-outside-repo
Oct 19, 2026
Merged

entelecheia merged 6 commits into
mainfrom
fix/294-admit-cpu-outside-repo

Conversation

@entelecheia

@entelecheia entelecheia commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Fixes #294.

dot admit deferred agent-hub's local checks five times on 2026-10-20. Each blocker was a background process that runs no build or test in any repository: Maru's dotfiles commands (cwd /) and claude-mem's one-turn observer (claude --max-turns=1, cwd ~/.claude-mem/observer-sessions). The CPU rule (100% or more) caught them. Their cwd lies outside every repository, so Repository stayed empty, which filterUncovered treats as unknown ownership, and that blocked every caller.

Change, in internal/admission/uncovered.go:

  • repositoryIdentity returns errNotRepository only when the walk reaches the filesystem root without a .git. Permission errors, invalid Git pointers and the 64-level depth cap stay unknown.
  • HeavyJob records CPUOnly (the CPU rule alone matched) and OutsideRepository (the cwd was observed, and errNotRepository was returned).
  • filterUncovered no longer counts a job that is both as unknown ownership.

Unchanged, and still blocking:

  • build-, test- or install-shaped work outside a repository;
  • a job whose cwd was not observed (lsof failure, partial batch);
  • maintenance-shaped work for the maintenance class.

The pressure thresholds still count these processes' load.

Tests, red-first: commit 74fabdf adds them alone and fails to build. They cover:

  • the filterUncovered table: busy outside a repo, unobserved cwd, shaped outside a repo, maintenance;
  • the repositoryIdentity sentinel against an invalid pointer;
  • CPUOnly for claude at 150% versus cargo build at 150%;
  • the process's own cwd resolving to this repository.

Checks: go test for internal/admission, internal/resourceguard and internal/cli passes with GOMAXPROCS=2 -p 2 -parallel 2. go vet is clean. internal/cli TestJSONGoldens fails only when CLAUDE_CONFIG_DIR points outside the preference home (this session's Orca profile); it passes with it unset, so that is environmental and unrelated. Full gate: CI.

Review round 1 (read-only reviewer: changes requested; #294 amended with D5, D6 and AC5):

  • D5: the same-repository clause now matches only a known repository. A caller outside every repository (project == "") no longer treats an exempted job as same-repository work.
  • AC5 tests: a live child process in a plain temporary directory resolves OutsideRepository=true, and one whose cwd was removed resolves to unknown. A nonexistent path is not errNotRepository. The empty-project case is pinned. The two mutations the reviewer found surviving (outside: false, outside: err != nil) now fail the package tests. TMPDIR inside a repository skips with a reason.
  • D6: the residual risk (unshaped work that builds a repository from a cwd outside it, such as a Gradle daemon, a VM container build or a script runner from ~) is recorded as an accepted ceiling in docs/CEILINGS.md, with a pinned ponytail marker. The pressure thresholds do not cover a single such process on a many-core host.
  • go test for admission, resourceguard, cli (with CLAUDE_CONFIG_DIR unset) and syncer passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KzeWFojtQKhDwcFrqZZv3Z

Copilot AI balanced review requested due to automatic review settings October 19, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T21:45:28.088185Z fd6bdbd PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@entelecheia
entelecheia merged commit d23bace into main Oct 19, 2026
13 checks passed
@entelecheia
entelecheia deleted the fix/294-admit-cpu-outside-repo branch October 19, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(admission): a busy process outside any repository is host load, not uncovered work of unknown ownership

2 participants