This repository was archived by the owner on Dec 3, 2026. It is now read-only.
Repository navigation
refactor: meta_core owns the workspace domain and the one process owner; the meta crate is a binary only [[tasks/harmony-3076]] - #162
Merged
Conversation
…used [[tasks/harmony-3076]]
…st [[tasks/harmony-3076]] crate-audit K0148. Members inherit with dep.workspace = true and keep their own extra features. release.yml pins the meta_core requirement in the root manifest, its one place now.
|
Warning Review limit reached
This review includes 38 billable files and costs up to $9.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 39 seconds for your next included review. View limit details
|
gold-silver-copper
force-pushed
the
refactor/core-owns-workspace-domain
branch
3 times, most recently
from
November 4, 2026 03:17
7b59ec6 to
037f93a
Compare
…y graph and queries; the meta crate is a binary only [[tasks/harmony-3076]] worktree, repo_filter, dependency_graph and query move from meta_cli's library into meta_core, unchanged. context and run_list, which only the meta binary uses, become its private modules. meta_git_lib, meta_git_cli, meta_project_cli and meta-mcp no longer depend on the meta crate.
…lled tool call or a plugin that doesn't answer stops everything it started [[tasks/harmony-3076]]
meta_core::children::spawn_group starts a child in a process group of its
own (a job object on Windows) and Owned::{try_wait, group_alive, stop}
check on and stop the whole group. meta-mcp's cancellable runs, its
finish-on-cancel git runs and meta's --meta-plugin-info probe use it, so
their three copies of the Unix group code and their three fallbacks
elsewhere are gone. On Windows, cancelling a tool call or a probe timing
out now ends the processes the program started too, not just the program
(cross-platform audit CX-meta-1, CO-meta-1, BX-meta-1, BO-meta-3).
gold-silver-copper
force-pushed
the
refactor/core-owns-workspace-domain
branch
from
November 4, 2026 03:20
037f93a to
0737751
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of the meta architecture plan:
meta_coreowns the workspace domain, themetacrate is only a binary, and one owner inmeta_core::childrenstarts, checks and stops every process group meta makes. Based on f44f0a4 (the #161 merge).What changes for users
META_OWNER_DEPTH=1like every child the owner starts, so ametathat meta-mcp runs gives its own children 1 s instead of 2 s to stop after a signal, and has killed them before meta-mcp's own 2 s grace kills it. Independent test on Linux: main left 5 orphaned processes in 6 of 9 cancels, this PR 0 in 9; the other 48 CLI scenarios are byte-identical to main.--meta-plugin-infowithin 5 s, meta now ends everything that program started (its job object), not just the program. Before, a.cmd/node wrapper died and the processes it started kept running and kept the pipe open. A release is needed beforeinstall.ps1users get this.What moved, and what replaces it
meta_cli::worktree,repo_filter,dependency_graph,query(themetacrate's library)meta_core::worktree,repo_filter,dependency_graph,query, unchangedmeta_cli::context,meta_cli::run_listmetabinary (only it used them)metacrate's[lib]targetmeta_git_lib,meta_git_cli,meta_project_cliandmeta-mcpdepend onmeta_coreonly (cargo tree -p meta_git_liblists nometa)meta_mcp/src/run.rs(group_alive,stop),meta_mcp/src/batch.rsandmeta_cli/src/subprocess_plugins.rs, each with its own Unix branch and fallbackmeta_core::children::spawn_groupplusOwned::{stdout, try_wait, group_alive, stop}A grouped child is registered like any other
children::spawnchild, so on Unix a signal meta owns reaches it, andtry_waittakes it off the list before it is reaped (no reused pid gets signalled). On Windows the group is a job object (thewin32jobcrate: a safe API, so the workspace keepsunsafe_code = "forbid"). The job only kills its processes whenstopis called: a job closed after a normal run leaves whatever its program left running, as a Unix group does.Also in this PR, as separate commits (crate-audit 2026-11-03, which the plan puts before this step):
meta_project_clino longer listsmeta_git_lib, which it never used.[workspace.dependencies]holds one version of each shared dependency (rayon was 1.5 in two crates and 1.7 in one). The release workflow's "Pin the meta_core requirement" step now rewrites the onemeta_coreline in the rootCargo.tomlinstead of one line in each of two crates.Numbers
#[test]functionscargo test --workspace)pubitems inmeta_coremetacrate's library),spawn_group,Owned::stdout,try_wait,group_alive,stopTarget revised: net lines. The plan estimated net −150 for this step. Measured: net +193. Evidence: the move is −8 (git sees renames; the +26/−26 in
worktree.rsaremeta_core::→crate::); the three hand-written group copies in meta-mcp and the probe went from 86 lines to 25; what the estimate didn't count is the owner itself: the Windows job objects (about +80 lines, two nested jobs after review) and the Unixtry_waitthat keeps a reaped pid off the signal list (about +40), each with its doc, plus the workspace dependency table (+22 net, one version per dependency). Cost: the Windows behaviour above, which the plan asks this step to land.Test budget revised: +1 test. The plan said 0 added. The cross-platform audit's premortem asks for one native Windows test that a grandchild is gone after a stop, and nothing else checks the job-object code:
stopping_a_group_ends_what_its_program_started(meta_core/src/children.rs,#[cfg(windows)]) runs on the Windows CI lane only.Fresh-Docker agentic test
A clean
rust:1-bookwormcontainer on box2 (no caches, no host target dir) cloned a bundle of base f44f0a4 and head 32d2554, built each withcargo build --workspace --bins, and ran the same commands in a fresh workspace for each: a root repo withapp(one modified file),platform(meta: true, with its own.meta.yamllistinginner, cloned atplatform/inner) andmissing(in the config, not cloned). Script:run.shin the ledger folder.Base and head printed identical output for every command (diffed). Head's output:
head 32d2554
meta -r git worktree create trefuses without--every-repoon both, as the command requires a repo choice; the run with--every-repocreates the set across the nested repo and skips the uncloned one.The process-owner commit changed after this run (review rounds 1-2: Windows code, a compile_error message, comments); the Unix code it ran is unchanged.
Decisions taken alone
contextandrun_listwere in themetacrate's library but only the binary used them: they became private binary modules instead of moving tometa_core(less public surface).win32job(safe API) rather thanwindows-syswithunsafe(the workspace forbids it) orprocess-wrap(its child type waits for the whole job and doesn't say whether the job is empty).stoptells to kill and closes. So a stop kills the whole tree,group_alivestill sees the processes until they have really exited (as a Unix group is waited for), a finished run's leftovers live on as on Unix, and a stop that fails to set kill-on-close keeps the job for the next stop to try again.unsafe). Said in the module doc.compile_error!instead of a guessed fallback (meta ships for Linux, macOS and Windows).rustixis now a dev-dependency ofmetaand gone frommeta-mcp: only tests use it.Plugins stay plugins
Owner decision received during this PR:
meta git,meta cargo,meta projectandmeta mcpstay separate plugin executables on top of meta, so anyone can writemeta jjormeta grepthe same way. This PR is consistent with it: plugins now reach the workspace domain throughmeta_core(and the protocol crate) and no longer link the host crate; nothing moves into themetabinary. The plan's later step that bundled plugins into the host (PR 3) is dropped. The revised plan (13 PRs) keeps this PR unchanged; its next step moves this process owner frommeta_core::childreninto the plugin SDK (meta_plugin::process) so the host and every plugin share it.The revision also takes release work out of scope. This PR still edits
release.yml's "Pin the meta_core requirement" step, because movingmeta_coreinto[workspace.dependencies](K0148) moves the line that step rewrites; without the edit its check would fail the publish job.Overlaps with other runs
prompts/meta.md: K0146 and K0148 are done here; that PR should drop them. K0147, K0149, K0150, K0152 are untouched.prompts/meta.md: BX-meta-1, BO-meta-3 (job objects) and CX-meta-1, CO-meta-1 (one owner) are done here; AO-meta-1/2, BO-meta-1/4, CO-meta-7 are not.meta_cli/src/dependency_graph.rsandrepo_filter.rs, which now live inmeta_core/src/. The plan freezes feat: pinned dependencies; worktree sets start pinned repos at their pin, meta git update in a set moves them there safely [[tasks/harmony-3045]] #160 and redoes it on the new crate graph.CI time
The macOS integration job took 9 min 37 s on the final head, against 8 min 02 s on the base run and 8 min 11 s on this PR's first head (32d2554), whose integration-relevant code is the same. The plan recorded 8.7-10.0 min for this job; the difference looks like runner variance, not this PR (it adds no bats test and no integration step), but it is one sample. Under the 10 min ceiling.
Review
Team-repo panel, read-only, Claude Opus and Codex
gpt-6.1-sol, perspectives rotated each round, two to three reviewers at a time:compile_error!text read as ameta …command by the docs testBoth must-fixes are fixed (two nested jobs; reworded message). Round 2's second wave saw 037f93a; the only change since is
meta_core's crates.io description. Notes taken: doc comments namespawn_group, a comment on the Finish path, a one-second head start in the Windows test against flakes. Notes left, as follow-ups:group_alivecould take&self; clippy on the Windows CI lane (it fails today onmeta_core/src/config.rs:2061, cross-platform audit AO-meta-1); the"<1"comment in the rootCargo.tomlstill mentions child-repo CI. CodeRabbit was rate-limited and left no review.Not verified
cargo clippy --target x86_64-pc-windows-msvc -p meta_coreon Linux and runs only in the Windows CI lane; nobody drovemeta-mcpcancellation on a Windows machine.meta_core/src/config.rs:2061(aneprintln!in a test, already on main) fails it there.Try it