Repository navigation
feat(utils): CapabilityAutoGenerator — persist schedule state and YAML capability output (v1.8.0, #217) - #4275
Merged
makr-code merged 3 commits intoMar 15, 2026
Conversation
#217) - Add optional state_db (RocksDBWrapper) parameter to constructor; load utils_capgen_state:<shard_id> entries on construction (AC-1) - processShard: skip regeneration when within schedule.interval (AC-2) - shouldUpdate: return true when doc-count delta >= min_document_change (AC-3) - saveCapability: serialize DomainCapability to YAML, atomic tmp->rename write (AC-4) - persistState: write timestamp + doc_count to utils_capgen_state:<shard_id> (AC-5) - Add focused tests (test_capabilityautogenerator_persist_state.cpp) - Register tests in tests/CMakeLists.txt - Add CI workflow capabilityautogenerator-persist-state-ci.yml Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
[WIP] [CapabilityAutoGenerator] Persist schedule and document count state
feat(utils): CapabilityAutoGenerator — persist schedule state and YAML capability output (v1.8.0, #217)
Mar 15, 2026
…w AC-5/AC-2 tests, stale banner - Make persistState() public (was private) so AC-5 is directly testable - Add PersistStateWritesNewEntryToRocksDB test (AC-5 direct DB write) - Add PersistStateOverwritesExistingEntry test (AC-5b idempotent overwrite) - Add PersistStateWithNullDbOnlyUpdatesMemory test (AC-5c null-safety) - Add ScheduleGateRespectsLastRunTimestamp test (AC-2 gate data verified) - Update stale file banner: TODOs: 3 -> 0, v0.0.34 -> v0.0.35 Co-authored-by: makr-code <[email protected]>
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.
Resolves three no-op TODOs in
capability_auto_generator.cppthat left schedule gating, document-count delta tracking, and capability file output entirely unimplemented.Description
Core implementation (
src/utils/capability_auto_generator.cpp,include/utils/capability_auto_generator.h)processShard()now comparesnow − last_run_timestamps_[shard_id]againstschedule.interval; returns early if within interval.shouldUpdate()readslast_document_counts_[shard_id]; short-circuits totruewhendelta >= min_document_change.saveCapability()serializes allDomainCapabilityfields viayaml-cpp, atomic write usingtmp → fs::rename.State persistence
std::shared_ptr<RocksDBWrapper> state_dbadded to constructor (backward-compatible defaultnullptr).loadPersistedState(): iteratesutils_capgen_state:…utils_capgen_state;range on construction; corrupt-entry errors deferred outsidemutex_to avoid I/O under lock.persistState(shard_id, timestamp, doc_count): public — updates in-memory maps + writesutils_capgen_state:<shard_id>JSON to RocksDB after each successful run. Public visibility allows migration/pre-seeding without exposing internals.Tests & CI (
tests/test_capabilityautogenerator_persist_state.cpp,tests/CMakeLists.txt,.github/workflows/capabilityautogenerator-persist-state-ci.yml)13 focused tests covering:
PersistStateWritesNewEntryToRocksDB/PersistStateOverwritesExistingEntry— direct AC-5 coverage now thatpersistState()is publicScheduleGateRespectsLastRunTimestamp— seeds a recent timestamp, verifies elapsed < interval and thatsaveCapability(which correctly bypasses the gate) still writes.tmpresidue), directory auto-creation, nullstate_dbsafety, multi-shard independenceCI: ubuntu-22.04/gcc-12, ubuntu-22.04/clang-15, ubuntu-24.04/gcc-13.
Type of Change
Testing
📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
Checklist
Original prompt
CapabilityAutoGenerator: Persist Schedule and Document Count State #4048🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.