Commit graph

1,373 commits

Author SHA1 Message Date
trvon
7fffac1cc3
test(p2p): add container convergence harness
docker-compose with two saged daemons + MinIO (R2 stand-in) + shared
volume, a multi-stage saged.Dockerfile, and a validation script driving
filesystem<->filesystem convergence and causal-ordering determinism
(scenarios 1 + 3).
2026-08-13 12:20:03 -06:00
trvon
ed8778163e
feat(cli): add yams p2p publish/read/status
Thin p2p command over the memory-sync service: publish <key> <value|@file>,
read <key>, and status (merged index summary + backend identity). Binary
values are hex-encoded in JSON output; config resolves from [memory_sync]
with --backend/--path/--node-id overrides.
2026-08-13 12:20:02 -06:00
trvon
bdc181b9c6
feat(memory-sync): wire service into daemon config + lifecycle
Add a typed [memory_sync] TOML section (enabled, node_id, backend,
path, sync_interval_ms) parsed into DaemonConfig, and start/stop the
MemorySyncService within ServiceManager: start after content-store init
(best-effort, relative paths resolve against the data dir), stop noexcept
in Phase 8 shutdown. No YAMS_* env knobs.
2026-08-13 12:20:02 -06:00
trvon
347da90df4
feat(memory-sync): add daemon config + service factory
Typed MemorySyncDaemonConfig parsed from the [memory_sync] TOML section
(enabled, node_id, backend, path, sync_interval_ms) plus
createMemorySyncService() which resolves filesystem/s3 backends and
constructs the service. No YAMS_* env knobs.
2026-08-13 12:20:02 -06:00
trvon
15bbaa8567
refactor(cli): extract testable post-init guidance
Factor the post-setup 'what next / how to configure' guidance into pure
formatLaterCommand/formatInitSummary builders so each decision branch's
help is testable without stdout, and add a focused test asserting the
later-command and ready-summary text. Output is byte-identical.
Portability allowlist line numbers updated for the shift.
2026-08-13 12:20:02 -06:00
trvon
7ad04189f5
refactor(cli): extract already-initialized init path
Factor the alreadyInitialized && !force_ branch out of the monolithic
execute() into a private handleAlreadyInitialized() helper. Behavior
preserved; setup decision/try nesting reduced. Portability allowlist
line numbers updated for the shift.
2026-08-13 08:33:15 -06:00
trvon
b5d50bf9e6
feat(memory-sync): add periodic sync service
Daemon-facing service owns the backend + sync loop and reconciles on a
configurable interval via a stoppable worker thread. Typed
MemorySyncConfig (nodeId, syncIntervalMs); start/stop idempotent and
stop noexcept-safe. Backend injected so filesystem and S3/R2 resolution
stay with the caller.
2026-08-13 08:17:01 -06:00
trvon
24a15e67d3
feat(memory-sync): add backend-agnostic sync loop
Publish memory records as content-addressed blobs plus a
version-vector-tagged index record per write; sync lists the index,
pulls records, and LWW-merges to a deterministic winner per logical
key. Backend injected (filesystem / S3-R2 interchangeable).
2026-08-13 08:13:44 -06:00
trvon
91c64d6192
feat(memory-sync): add version-vector + LWW data model
Version vector (element-wise max merge, dominates/concurrent partial
order) plus hybrid timestamp and LWW resolution: causally-later writes
win, concurrent writes resolve deterministically by (ts, origin). JSON
serialization via nlohmann. Header-only, no library deps.
2026-08-13 08:05:01 -06:00
trvon
b7eaea8263
test: move stress cases to slow suite
Stress-tagged cases ran in the default unit lane because only ~[slow]
was filtered. Tag them [slow] and add ~[slow]/[slow] splits to the five
binaries (mcp_submodule, work_coordinator, daemon_background,
plugin_infrastructure, hybrid_search) so they run in the slow suite.
2026-08-12 20:36:16 -06:00
trvon
c64fae7eac
test(storage): tag refcount stress cases slow
Stress cases with 20 threads / 200 iterations run in the default unit
lane because only ~[slow] is filtered. Tag them [slow] so they move to
the storage_submodule_slow suite.
2026-08-12 20:31:09 -06:00
trvon
e1abefaf6f
ci(gate): distinguish transient infra from real failures
Retry setup.sh dependency resolution up to 3 times on Conan network
timeouts with backoff; report a distinct infra-retry (exit 77) when the
network failure persists, while real compile/test failures still fail
hard. Prevents a transient center2.conan.io timeout masquerading as a
code failure.
2026-08-12 20:09:40 -06:00
trvon
c9fbee0d50
ci(cross): add compile-only cross-compile smoke
Detects mingw-w64/linux-gnu cross compilers and compiles a portability
probe with -fsyntax-only to catch narrow-vs-wide API and std::jthread
issues before GitHub CI. Skips cleanly when no toolchain is present;
--self-test proves dispatch and failure propagation with a fake compiler.
2026-08-12 20:02:23 -06:00
trvon
b34bfcf508
test(portability): add cross-platform lint gate
Catch Windows/Linux/macOS-only defect classes before push: raw
std::jthread, sqlite3_open* via bare path.c_str(), and raw getenv
reads outside the config boundary. Wired into pre-commit and the
unit/policy suite; 575 reviewed sites allowlisted.
2026-08-12 19:54:02 -06:00
trvon
9a234f449f
test(metadata): clone DB template via VACUUM INTO
copy_file of the migrated WAL-mode template plus -wal/-shm sidecars
corrupts WAL replay on Windows (stale -shm), losing kg_nodes. VACUUM
INTO produces a self-contained single-file copy; a probe verifies the
KG schema survived the clone.
2026-08-12 19:32:48 -06:00
trvon
8911c5fa5e
fix(config): distinguish empty from unset env on Windows
_putenv_s removes a variable for "" and returns EINVAL for NULL, so the
CRT environment cannot represent an explicitly empty value; the boundary
collapsed unset and empty into one state. Read/write through the Win32
environment (SetEnvironmentVariableA/GetEnvironmentVariableA) instead,
keeping a best-effort _putenv_s sync so legacy std::getenv readers stay
coherent, and treat the empty-vs-unset read race fail-closed.
2026-08-12 19:14:34 -06:00
trvon
4e4c4142f4
fix(plugins): honor lifecycle RPC timeout
Use ExternalPluginHostConfig::defaultRpcTimeout for discovery, load, initialization, health, restart, and shutdown calls so sanitizer-slow plugin startup does not fall back to JsonRpcClient's hidden three-second default.
2026-08-12 14:21:26 -06:00
trvon
f392cf0954
style(tests): align validation formatting 2026-08-12 12:29:12 -06:00
trvon
be24d07c27
fix(ci): stabilize sanitizer validation
Rebuild macOS TSan outputs so compiler instrumentation and compiler-rt come from one Apple toolchain generation. Preserve daemon fixture dependencies until ServiceManager teardown so sanitizer lanes do not exercise a test-only use-after-free.
2026-08-08 11:42:33 -04:00
trvon
db7366509d
build(deps): update Simeon concept mining
Point the submodule at the reviewed, published optimization so clean CI clones can resolve it.
2026-08-07 21:13:20 -04:00
trvon
7485b482f8
fix(build): restore clean test and benchmark links 2026-08-06 09:59:07 -04:00
trvon
b1cefa4179
fix(bench): reject unknown arguments 2026-08-05 20:53:19 -04:00
trvon
45d617d5a3
fix(config): revoke removed tuning overrides 2026-08-05 20:53:19 -04:00
trvon
03aed28eda
fix(config): stack daemon environment leases 2026-08-05 20:53:19 -04:00
trvon
fb7e76bb39
test(policy): gate configuration authority 2026-08-05 20:53:19 -04:00
trvon
67b1f894c1
perf(search): optimize concept mining warmup 2026-08-05 20:53:19 -04:00
trvon
88a77addd5
refactor(bench): type run configuration 2026-08-05 20:53:18 -04:00
trvon
30618eb113
refactor(config): consolidate runtime tuning 2026-08-05 20:53:18 -04:00
trvon
9c9e19199e
refactor(test): consolidate daemon harness 2026-08-05 20:53:18 -04:00
trvon
424d91f771
refactor(metadata): extract content transaction seams 2026-08-05 20:53:18 -04:00
trvon
4d7f15dd5c
refactor(bench): isolate benchmark controls 2026-08-05 20:53:18 -04:00
trvon
8b501a344e
refactor(config): consolidate embedding policy 2026-08-05 20:53:18 -04:00
trvon
bdd7281077
fix(mcp): restore WASI final linkage
Keep config and native subsystems out of the minimal archive and export the profile definition so consumer ABI matches.
2026-08-05 20:53:17 -04:00
trvon
e85339ac30
refactor(config): unify flat TOML lookups 2026-08-05 20:53:17 -04:00
trvon
5066fc0893
test: isolate process environment 2026-08-04 21:31:39 -04:00
trvon
34a799d10e
refactor(config): unify environment policy 2026-08-04 14:35:10 -04:00
trvon
72c8d21054
refactor(config): centralize runtime paths 2026-08-04 13:10:40 -04:00
trvon
8ed1cc6696
fix(daemon): propagate startup failures 2026-08-04 11:48:38 -04:00
trvon
1a2d0f905b
fix(daemon): preserve ingestion admission 2026-08-03 17:52:58 -04:00
trvon
3f017dd47a
bench(ingestion): validate Simeon lifecycle 2026-08-03 17:52:58 -04:00
trvon
fbb8fcb915
perf(vector): persist reusable warm starts 2026-08-03 17:52:58 -04:00
trvon
b319f0de6f
perf(daemon): trust clean metadata restarts 2026-08-03 17:52:58 -04:00
trvon
745818e67d
perf(topology): streamline artifact construction
Reuse admitted relations and dense splitter state while preserving deterministic identities, centroids, and the 64-document safety cap.

Add corpus-shaped benchmarks so construction regressions stay measurable.
2026-08-03 17:52:58 -04:00
trvon
d03ffd07b3
refactor(plugins): centralize lifecycle policy 2026-08-03 17:52:58 -04:00
trvon
77c4bdff40
test: isolate integration state 2026-08-03 15:40:16 -04:00
trvon
f2c051cf27
fix(daemon): clarify IPC response mismatches 2026-08-01 11:28:04 -04:00
trvon
9ff5aa7ba1
perf(storage): slice-by-8 CRC32 on all crc paths, 13.7x faster
Profiling running daemon: bit-by-bit CRC32 top CPU consumer (2289
samples/15s during grep). Same algorithm/polynomial, byte-identical
output (oracle test 0..512 len), stored checksums stay valid.

Applies slice-by-8 everywhere crc ran:
- yams::common::crc32 (+ crc32Update seeded variant for mid-stream)
- compression::calculateCRC32/updateCRC32 delegate to it
- storage-local duplicate copy removed (dead scope)
- WAL entry checksum copy removed

Also restructures sizeof arithmetic in WAL size math so opengrep does
not misread it as pointer arithmetic.
2026-08-01 00:12:32 -04:00
trvon
4c3eb3d018
refactor: dedup retry helpers + test fixtures
- isTransientMetadataError + MetadataTelemetry: 2 copies (grep/search)
  -> shared service_utils.hpp
- grep_service local string_contains -> shared features::string_contains
- ArtifactGuard: 5 identical copies in corruption tests -> shared
  tests/common/sqlite_corruption.h

retryMetadataOp loops stay split (async coroutine vs sync sleep - real
difference). annotateResultRelations/applyFileTypeFilters/formatSnippet
deferred: behavior parity question, not mechanical dedup.
2026-08-01 00:12:32 -04:00
trvon
728a304f29
refactor(cli): share time filters between get/list
Same 6-field time filter logic copy-pasted in GetCommand and ListCommand
(~72 lines each). Extract to yams::cli::applyDocTimeFilters + DocTimeFilters,
wire both commands, add unit test.
2026-08-01 00:12:31 -04:00
trvon
3b1c86f490
refactor: deduplicate trim/escapeRegex/hasWildcard helpers
The same string helpers were copy-pasted across CLI and service code:
trim/trimCopy in 5 files, escapeRegex in 3, hasWildcard in 2, and the
regex meta-char table in 2. Move canonical versions to
yams::common::string_utils.h (trimCopy, hasWildcard, escapeRegex,
isRegexMetaChar) and wire all call sites to them; daemon_helpers'
trim_copy now delegates. Add a Catch2 test for the shared helpers.

Kept isTransientMetadataError and annotateResultRelations untouched:
they have semantically different implementations and need a separate
review, not a mechanical merge.
2026-08-01 00:12:31 -04:00