refactor: remove redundant feature gates, promote index into full - #6747
Merged
Conversation
Classify all 184 workspace feature keys (root + 28 crates) and remove
the 27 that provide no real modularity benefit: several are empty
markers (deep-link, cocoon), several are already unconditionally
enabled by non-optional dependencies (llm-planning, zeph-core/sysinfo),
and several gate a single tiny reqwest sub-feature (registry). Convert
their #[cfg(feature = ...)] sites to unconditional code and their
optional deps to mandatory ones. Fix zeph-skills's `miner` feature to
declare explicit dep: prefixes instead of silently synthesizing 5
implicit feature keys.
Add `index` to the `desktop`/`full` bundles instead of removing its
gate, since it pulls in real per-crate dependency weight (+43 packages
for zeph-agent-context) that a REMOVE would have unconditionally
charged every consumer, including published-crate users. This is the
first time `full` compiles the zeph-index integration; fix an E0063 in
zeph-agent-context test code the new combination exposed.
Drop `testing` from the `full` bundle (breaking): `full` drove
release-build-full, silently shipping mock LLM providers in release
binaries. Consumers relying on `--features full` for test doubles must
now request `testing` explicitly.
Explicitly keep gated: sqlite/postgres and metal/cuda (mutually
exclusive backends), profiling (spec 035 FR-002 requires it compile to
a no-op when disabled), zeph-skills/qdrant, zeph-a2a/{card-signing,
ibct,server} (all carry real per-crate package cost once measured
correctly, not via the workspace-root binary), zeph-core/scheduler
(load-bearing propagation marker), session (coverage status is
Partial, deferred), and zeph-acp/unstable-cancel-request (deliberate
opt-in per #5362).
Update the 6 CI workflows whose hand-copied feature strings had
drifted from Cargo.toml, amend specs 001/029 to match the new
classification rules and bundle composition, rewrite the stale
book/src/reference/feature-flags.md page, and fix two other
user-facing docs (config/default.toml, book/src/advanced/acp.md) that
referenced now-removed flags.
Net effect: 184 -> 157 feature keys, 0 added package-dependency cost
for the removed set.
bug-ops
enabled auto-merge (squash)
August 25, 2026 01:12
Removing the cocoon feature gate elsewhere in this branch made AnyProvider::Cocoon(CocoonProvider) an unconditional enum variant, growing the future returned by handle_run_baseline past clippy's large_futures threshold (16624 bytes) under the bench feature build. Box the two call sites per clippy's own suggested fix.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Audited all 184 Cargo feature keys across the workspace (root
Cargo.toml+ 28 crates), classified each as either an unconditional/always-on candidate or a genuinely required modularity boundary, and implemented the ratified classification:deep-link,cocoon), keys already unconditionally enabled by non-optional dependencies (llm-planning,zeph-core/sysinfo), and single-tiny-subfeature gates (registry). Fixedzeph-skills'sminerfeature to declare explicitdep:prefixes instead of silently synthesizing 5 implicit feature keys.indexto thedesktop/fullbundles instead of removing its gate — it carries real per-crate dependency weight (+43 packages forzeph-agent-context) that removing the gate would have unconditionally charged to every consumer, including published-crate users. This is the first timefullcompiles thezeph-indexintegration; fixed anE0063inzeph-agent-contexttest code the new combination exposed.testingfrom thefullbundle (breaking change) —fulldrivesrelease-build-full, which was silently shipping mock LLM providers in release binaries. Consumers relying on--features fullfor test doubles must now requesttestingexplicitly.Kept gated, with reasoning verified per-crate (not just at the workspace-root binary, which hides published-crate consumer cost):
sqlite/postgresandmetal/cuda(mutually exclusive backends,sqlite/postgresenforced bycompile_error!),profiling(spec 035 FR-002 requires it compile to a no-op when disabled),zeph-skills/qdrant,zeph-a2a/{card-signing,ibct,server},zeph-core/scheduler(load-bearing propagation marker),session(coverage status isPartial, deferred out of this PR),zeph-acp/unstable-cancel-request(deliberate opt-in per #5362).Also: fixed 6 CI workflows whose hand-copied feature strings had drifted from
Cargo.toml, amended specs 001/029 to record the new classification rules and bundle composition, rewrote the stalebook/src/reference/feature-flags.mdpage, and fixedconfig/default.tomlandbook/src/advanced/acp.md, which referenced now-removed flags.Net effect: 0 added package-dependency cost for the entire removed-gate set.
Process
Produced via a 3-round architect/critic classification pass before any code was touched (
.local/plan/feature-flags-classification.md, v3 — ratified, 0 open questions), followed by implementation, parallel test-coverage + adversarial-critique validation, and code review with one fix-review cycle (2 blocking documentation issues found and fixed: staleconfig/default.tomlflag references, stalebook/src/advanced/acp.mdunstable-flag examples that would hard-fail withunknown feature).Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --workspace --lib --binson default features (scheduler,sqlite) — 14879/14879 passedcargo nextest run --workspace --features full --lib --bins— 15608/15608 passedcargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler"RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --lockedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace ...)--no-default-features --features full,sqliteandfull,postgresboth compile cleansqlite/postgresmutual-exclusioncompile_error!guard re-verified (fires correctly both-enabled and neither-enabled)cargo metadata --no-depsreports exactly 157 feature keys post-refactorzeph doctorwith--features fulland[index] enabled = true.local/testing/playbooks/feature-flags.md,.local/testing/coverage-status.md)Two pre-existing, out-of-scope issues surfaced during validation (not fixed here, filed for follow-up): a
zeph-corerustdoc failure specific to the untestedprofiling-alloccombination, and an orphanedzeph-experiments/mockfeature with no code consumer.