feat: migration breadth, project templates, preset export, IDE/registry polish
VoidBuildSystem CI / 1 · Requirements (push) Successful in 3s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 2m11s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m33s
VoidBuildSystem CI / 2A · Linux build (coverage) (push) Successful in 2m44s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 4m16s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m37s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m29s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 24s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m52s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 20s
VoidBuildSystem CI / 3A · Linux test (coverage) (push) Failing after 1m57s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 6m47s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 7m4s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Skipped
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped

- vbs migrate --from meson: bounded meson.build importer (project, variable
  assignments, files()/include_directories(), executable/static_library/
  shared_library/library with link_with, include_directories, dependencies,
  install/install_dir) rendering the same build.cpp scaffold; everything
  untranslated is reported as a note.
- vbs init --template app|library|header-only|shared; every template
  scaffolds a project whose own test passes.
- vbs presets --export FILE: writes VBS profiles as CMake configure presets
  (round-trips through the CMakePresets importer).
- vbs ide generate also writes JetBrains run configurations per target.
- VBS_HOST_CXX_FLAGS/VBS_HOST_LDFLAGS instrument the compiled build
  descriptor (the CI sanitizer lane sets them).
- The registry queue counts lease attempts and abandons an action after 5
  attempts into a dead-letter list instead of leasing it forever.
- CI: coverage lane (lcov report), sanitizer descriptor flags; docs ledger
  brought up to date (STATE/TASKS/superiority roadmap).

Verified: the new FullV1Tests and RegistryTests cases pass and the full
CTest suite passes 8/8.
This commit is contained in:
faumaray committed 2026-12-06 17:23:59 +03:00
1 parent 9da1387031
commit fe453bd601
17 files changed
+898 -54

No files matched your search

@@ -179,6 +179,11 @@ class RegistryService {
std::map<std::string, WorkerRecord, std::less<>> workers_;
std::map<std::string, ActionLeaseRecord, std::less<>> action_leases_; // action_key -> lease
std::vector<std::string> action_queue_; // enqueued action keys (in-memory)
// Leases handed out per queued action; after kMaxActionAttempts the action is abandoned
// (dead-lettered) instead of being retried forever.
std::map<std::string, std::uint32_t, std::less<>> action_attempts_;
std::vector<std::string> abandoned_actions_;
static constexpr std::uint32_t kMaxActionAttempts = 5;
std::uint64_t worker_sequence_{0};
std::vector<AuditEntry> audits_;
HttpServer server_;
+38 -10
View File
@@ -1045,9 +1045,18 @@ HttpResponse RegistryService::handle_request(const HttpRequest &req) {
leased_keys.push_back(key);
}
}
std::string attempts_json;
for (const auto &[key, attempts] : action_attempts_) {
if (!attempts_json.empty()) {
attempts_json += ',';
}
attempts_json += json_quote(key) + ":" + std::to_string(attempts);
}
return HttpResponse::json(
200, "{\"pending\":" + json_array(pending, json_quote) +
",\"leased\":" + json_array(leased_keys, json_quote) + "}\n");
",\"leased\":" + json_array(leased_keys, json_quote) +
",\"attempts\":{" + attempts_json + "}" + ",\"abandoned\":" +
json_array(abandoned_actions_, json_quote) + "}\n");
}
if (segs.size() == 3 && req.method == "POST") {
if (!principal->scopes.contains("publish") && principal->role != Role::Admin) {
@@ -1102,24 +1111,42 @@ HttpResponse RegistryService::handle_request(const HttpRequest &req) {
return HttpResponse::error_json(404, "not_found", "worker not registered");
}
prune_expired_leases();
const auto next = std::ranges::find_if(action_queue_, [&](const std::string &key) {
return !action_leases_.contains(key);
});
if (next == action_queue_.end()) {
// Skip actions that exceeded their attempt budget (dead-letter them).
std::optional<std::string> picked;
for (auto it = action_queue_.begin(); it != action_queue_.end();) {
if (action_leases_.contains(*it)) {
++it;
continue;
}
auto &attempts = action_attempts_[*it];
if (attempts >= kMaxActionAttempts) {
abandoned_actions_.push_back(*it);
append_audit_locked(principal->username, "queue.abandon", *it,
"attempts_exhausted", std::to_string(attempts));
action_attempts_.erase(*it);
it = action_queue_.erase(it);
continue;
}
++attempts;
picked = *it;
break;
}
if (!picked) {
return HttpResponse::error_json(404, "empty", "no queued action available");
}
ActionLeaseRecord lease;
lease.action_key = *next;
lease.action_key = *picked;
lease.worker_id = worker_id;
lease.lease_token = random_hex(16);
lease.expires_epoch = now_epoch() + lease_seconds;
action_leases_[*next] = lease;
append_audit_locked(principal->username, "queue.lease", *next, "ok", worker_id);
action_leases_[*picked] = lease;
append_audit_locked(principal->username, "queue.lease", *picked, "ok", worker_id);
return HttpResponse::json(
200, "{\"action_key\":" + json_quote(*next) +
200, "{\"action_key\":" + json_quote(*picked) +
",\"worker_id\":" + json_quote(worker_id) +
",\"lease_token\":" + json_quote(lease.lease_token) +
",\"expires_epoch\":" + std::to_string(lease.expires_epoch) + "}\n");
",\"expires_epoch\":" + std::to_string(lease.expires_epoch) +
",\"attempt\":" + std::to_string(action_attempts_[*picked]) + "}\n");
}
}
@@ -1295,6 +1322,7 @@ HttpResponse RegistryService::handle_request(const HttpRequest &req) {
action_leases_.erase(lease_it);
action_queue_.erase(std::remove(action_queue_.begin(), action_queue_.end(), action_key),
action_queue_.end());
action_attempts_.erase(action_key);
append_audit_locked(principal->username, "action.result", action_key, "ok",
existed ? "replaced" : "stored");
return HttpResponse::json(200, "{\"stored\":true}\n");