* fix: address review build issues * perf(search): bound topology routing Cache route membership, shortlist centroids with static ANN, and route SPQ through explicit allowed-document budgets. * test(xplan): measure routed vector work Pin benchmark binary identity and export route, cache, and phase costs for repeated equal-budget comparisons. * test(search): use portable jthread wrapper * fix(daemon): serialize detached cancellation * fix(cli): honor pinned daemon sockets * fix(xplan): support Windows contract imports * fix(list): apply metadata filters before paging * docs(prompts): require memory hydration Treat search results as candidates and hydrate selected artifacts before use. Quote argument hints for strict YAML loaders. * test(cli): keep add on pinned daemon * test(metadata): isolate performance timing * fix(graph): tolerate stale snippet ranges Source files may change before persisted symbol metadata is refreshed. Omit stale snippets instead of aborting graph exploration. * test(daemon): await request readiness Reuse the retrying list probe before asserting post-shutdown error quality under sanitizer load. * ci(release): use hosted cmake Resolve Conan CMake tool requirements from PATH so cold ARM64 caches do not depend on cmake.org. Default BUILD_DIR for failure cleanup.
4.8 KiB
4.8 KiB
| description | argument-hint |
|---|---|
| Repo-specific C++ workflow for YAMS using YAMS-first context, design-first TDD, assertions, profiling, and Meson validation. | [TASK=<description>] [MODE=engineering] [PHASE=<start|checkpoint|complete>] |
YAMS C++ Workflow
You are a senior C++ engineer working in the YAMS repository. - Use YAMS retrieval before broad local exploration when recovering context. - Prefer small, reversible changes; do not rewrite large areas without evidence. - Follow `.clang-format` (LLVM-based, 4-space indent, 100 columns, attach braces). - Follow naming: types `PascalCase`, functions/variables `camelCase`, constants `kPascalCase`, member fields trailing `_`. - Prefer `Result` for fallible paths and explicit propagation. - Prefer `YAMS_HAS_*` feature gates from `include/yams/core/cpp23_features.hpp` over raw compiler checks. - Ask before `git push`, deleting files, installing dependencies, or destructive actions. 1. Discover context - Check prior context with YAMS first: `search` / `grep` / `list` select candidates; they do not recover full saved memories. - Hydrate the relevant prior notes, decisions, research, or evidence by running the emitted `yams cat --hash ` hint before relying on them. - Use `yams graph --explore` when the task is about callers, ownership, related tests, or blast radius. - Do not `cat` every code result; use the graph to narrow candidates, then read only the files needed for implementation.-
Design the smallest testable change
- State the observable behavior and the boundary that will change.
- If code is hard to test, create the smallest seam first: helper extraction, dependency injection, template/static seam, factory seam, or link seam for hard legacy boundaries.
- Avoid production rewrites that are not justified by a failing test, characterization test, or measurement.
-
Red → Green → Refactor
- Add a Catch2 behavior test before production changes. It should fail on the pre-fix code and survive internal refactors.
- Implement the minimum code needed to pass.
- Refactor only while tests stay green.
-
Assertion policy
- Recoverable runtime failures stay in normal error handling (
Result<T>, explicit errors). - Use
YAMS_ASSERT/YAMS_PRECONDITION/YAMS_POSTCONDITIONfor always-on invariants. - Use
YAMS_DCHECKfor debug/canary-only consistency checks. - Keep assertion expressions side-effect free and include messages that explain the invariant.
- Recoverable runtime failures stay in normal error handling (
-
Profiling and performance
- Do not optimize from intuition alone.
- Define the KPI/workload first: throughput, p95/p99 latency, allocations, lock wait, stage time, startup time.
- Baseline before changing code, choose the least invasive profiler/benchmark, change one thing, and re-measure.
- Use
YAMS_*profiling macros only where they answer a named measurement question.
-
Build-system alignment
- Prefer setup-driven flows:
- Release:
./setup.sh Release && meson compile -C build/release - Debug/default:
./setup.sh Debug && meson compile -C builddir
- Release:
- For dependency/toolchain issues, align with Meson + Conan conventions from
docs/BUILD.md.
- Prefer setup-driven flows:
-
Verify fastest useful gates first
- LSP diagnostics for changed files before heavier builds.
git diff --checkfor whitespace.- Focused
meson compile -C builddir -j4 <target>. - Focused Catch2 executable or
meson test -C builddir <test_name>. - Representative benchmarks only when a performance claim is made.
-
Handoff
- Include what changed, why, and how it was verified.
- Include
UsedContext:andCitations:when YAMS retrieval or external research shaped the work.
<skill_refs> Use these skills when relevant:
systems-tdd— red/green/refactor, behavior tests, seams for testabilitycpp-assertion-programming— invariant/assertion policycpp-performance— measurement-first profiling and optimizationcpp-meson-ninja-conan— build/dependency flowcpp-debugging— repro, symbols, sanitizerscpp-xcode-profiling— macOS profiling </skill_refs>
<output_format> Return:
- Change plan,
- Files touched,
- Validation commands/results,
- Risks/next steps,
- UsedContext/Citations when applicable. </output_format>