Skip to content

Allow the e2e runner to run in read-only mode - #945

Merged
jviotti merged 2 commits into
mainfrom
runner-readonly
Oct 23, 2026
Merged

jviotti merged 2 commits into
mainfrom
runner-readonly

Conversation

@jviotti

@jviotti jviotti commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

View guided diff

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/e2e/runner.cc">

<violation number="1" location="test/e2e/runner.cc:96">
P2: `check_size_artifact` can accept a corrupted size artifact because `std::stoull` ignores trailing characters, and malformed nonnumeric content terminates the runner via an uncaught exception. Parse the complete file content, allowing only the expected trailing newline, and report invalid values as mismatches.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread test/e2e/runner.cc Outdated
}

const auto expected{static_cast<std::string::size_type>(
std::stoull(sourcemeta::core::read_file_to_string(path)))};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: check_size_artifact can accept a corrupted size artifact because std::stoull ignores trailing characters, and malformed nonnumeric content terminates the runner via an uncaught exception. Parse the complete file content, allowing only the expected trailing newline, and report invalid values as mismatches.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At test/e2e/runner.cc, line 96:

<comment>`check_size_artifact` can accept a corrupted size artifact because `std::stoull` ignores trailing characters, and malformed nonnumeric content terminates the runner via an uncaught exception. Parse the complete file content, allowing only the expected trailing newline, and report invalid values as mismatches.</comment>

<file context>
@@ -1,31 +1,131 @@
+  }
+
+  const auto expected{static_cast<std::string::size_type>(
+      std::stoull(sourcemeta::core::read_file_to_string(path)))};
+  if (expected == actual) {
+    return true;
</file context>

@augmentcode

augmentcode Bot commented Oct 23, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Makes the e2e runner read-only by default.
Tests validate saved artifacts instead of overwriting them during normal runs.
Changes:

  • Adds --write and -w to explicitly regenerate artifacts.
  • Generates canonical and compiled encoding JSON in memory.
  • Uses string streams for binary encoding and round-trip decoding.
  • Compares generated JSON, binary output, and byte counts against saved artifacts.
  • Reports missing files, text mismatches, binary difference offsets, and size differences.
  • Prints an artifact-update command when comparisons fail.
Technical notes: Adds core I/O and options dependencies; artifact writes follow successful round-trip validation.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit 8cd1445 into main Oct 23, 2026
14 checks passed
@jviotti
jviotti deleted the runner-readonly branch October 23, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant