Преглед на файлове

Count the string fields in the catalog contract text

The strings ledger entry said 54 StringRef fields while the table holds
56. It now prints the declared count.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
stan преди 4 дни
родител
ревизия
2a75db014d
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      Sunrise/src/client/content/activity/activity_sdk_lua_catalog_contract.cpp

+ 4 - 1
Sunrise/src/client/content/activity/activity_sdk_lua_catalog_contract.cpp

@@ -417,12 +417,15 @@ append_raw_field(Value::Object& fields, std::string_view code, std::string_view
 
 
 /** Ledger entry for the strings section; the view field appears only in the projection ledger. */
 /** Ledger entry for the strings section; the view field appears only in the projection ledger. */
 [[nodiscard]] Value strings_projection(bool includeView) {
 [[nodiscard]] Value strings_projection(bool includeView) {
+    std::string surface("context.sdk.catalog.<all ");
+    surface.append(std::to_string(kDecodedStringFieldCount));
+    surface.append(" StringRef value/offset/length fields>");
     Value::Object fields{
     Value::Object fields{
         {"projection_mode", string("authenticated_parent_bounded_string_refs")},
         {"projection_mode", string("authenticated_parent_bounded_string_refs")},
         {"section", string("strings")},
         {"section", string("strings")},
         {"section_index", number(0)},
         {"section_index", number(0)},
         {"source_artifact", string("activity_sdk.runtime_pack")},
         {"source_artifact", string("activity_sdk.runtime_pack")},
-        {"surface", string("context.sdk.catalog.<all 54 StringRef value/offset/length fields>")},
+        {"surface", string(surface)},
     };
     };
     if (includeView) {
     if (includeView) {
         fields.push_back({"view", string("decoded_utf8_string_or_nil_with_raw_StringRef")});
         fields.push_back({"view", string("decoded_utf8_string_or_nil_with_raw_StringRef")});