feat: /etc/conf.d file-based config with VFS mount#2822
feat: /etc/conf.d file-based config with VFS mount#2822joezhoujinjing wants to merge 5 commits intodevelopfrom
Conversation
Introduce Linux-style /etc/conf.d/ configuration: - New `nexus.etc` module for loading TOML brick config files - Auto-mount $STATE_DIR/etc as /etc in VFS (readonly) - NEXUS_STATE_DIR env var (default ~/.nexus) as the ONE bootstrap param - `nexus config init` command to generate default conf.d files - Mount brick POC: conf.d/mounts auto_sync with env var fallback - Ship default etc/conf.d/ files in repo (all commented, self-documenting) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Type Safety Progress 📉Current: 246 type: ignore comments ✅ Progress! Keep eliminating type suppressions! |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.
| Benchmark suite | Current: 8b69a15 | Previous: 8cca243 | Ratio |
|---|---|---|---|
tests/benchmarks/test_core_operations.py::TestBulkOperationBenchmarks::test_write_batch_10 |
27.782551347008656 iter/sec (stddev: 0.0020315741473701343) |
39.188778970248656 iter/sec (stddev: 0.001138536110711972) |
1.41 |
tests/benchmarks/test_rebac_latency.py::TestL1CacheHit::test_l1_cache_hit_latency |
16491.911506075077 iter/sec (stddev: 0.00000567799508504349) |
29000.081830264273 iter/sec (stddev: 0.000003409453269809088) |
1.76 |
tests/benchmarks/test_service_delegation.py::TestAsyncDelegationOverhead::test_version_get_delegation |
6563.795088175207 iter/sec (stddev: 0.0000265085031658731) |
8930.124477576594 iter/sec (stddev: 0.00003489369801859649) |
1.36 |
tests/benchmarks/test_service_delegation.py::TestAsyncDelegationOverhead::test_rebac_check_delegation |
6537.196394476286 iter/sec (stddev: 0.00002004745764648793) |
8769.424929753402 iter/sec (stddev: 0.000028394751338990928) |
1.34 |
tests/benchmarks/test_service_delegation.py::TestAsyncDelegationOverhead::test_mcp_list_mounts_delegation |
6647.241220956916 iter/sec (stddev: 0.000023017785567831498) |
8921.993016840954 iter/sec (stddev: 0.00003357628815439365) |
1.34 |
This comment was automatically generated by workflow using github-action-benchmark.
Replace the PathLocalBackend mount at /etc with sys_write calls that give each config file proper metastore entries. This makes sys_read, sys_stat, and sys_readdir work through the normal VFS pipeline without needing kernel modifications for path-based backends. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Type Safety Progress 📉Current: 246 type: ignore comments ✅ Progress! Keep eliminating type suppressions! |
When $STATE_DIR/etc/ doesn't exist, _mount_etc() now copies default config files from the repo's etc/conf.d/ directory before writing them into the VFS. This makes connect() work from a clean state without requiring `nexus config init` first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Type Safety Progress 📉Current: 246 type: ignore comments ✅ Progress! Keep eliminating type suppressions! |
Remove other default conf.d files (cache, database, llm, permissions, search, uploads). They'll be added back as each brick is migrated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Type Safety Progress 📉Current: 246 type: ignore comments ✅ Progress! Keep eliminating type suppressions! |
Mount $STATE_DIR/etc as /etc using PathLocalBackend so writes go to the actual filesystem path instead of CAS blobs. sys_write is called at boot to create metastore entries for sys_read/stat/readdir support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Type Safety Progress 📉Current: 246 type: ignore comments ✅ Progress! Keep eliminating type suppressions! |
Directionally, a nexus config command and file-backed brick config make sense for the CLI. I would not merge this version yet; it needs packaged defaults plus a |
Summary
/etc/conf.d/brick configuration patternnexus.etcmodule — each brick callsget_brick_config("name")to load its own TOML config$STATE_DIR/etcas/etcin VFS (readonly) — config self-hostingNEXUS_STATE_DIRenv var (default~/.nexus) as the single bootstrap parameternexus config initcommand to generate default conf.d filesetc/conf.d/files in repo (all commented out, self-documenting)auto_syncfrom/etc/conf.d/mountswith env var fallbackDesign
Boot sequence:
NEXUS_STATE_DIR→ hardcode kernel paths (metastore, data, etc)$STATE_DIR/etc→/etc(readonly PathLocalBackend)get_brick_config()to load their own/etc/conf.d/{name}Each brick loads its own config (like Linux daemons), no factory coupling.
Precedence: CLI args > env vars (deprecated) > conf.d files > profile defaults.
Test plan
nexus.etc(TOML loading, missing files, malformed TOML, env var resolution)/etcVFS mount (readonly, routing, skip when missing, conf.d integration)🤖 Generated with Claude Code