Repository navigation
fix(templates,test): clarify swe_issue_readiness repro_steps vs env_or_logs and test JSX/Helm braces - #102
Merged
ghchinoy merged 1 commit intoDec 3, 2026
Conversation
jigyasujuneja
left a comment
Collaborator
There was a problem hiding this comment.
Good direction separating repro_steps from env_or_logs and checking template delimiters. A few small items to tighten before merge (happy to approve after):
- Merge conflict with #103:
git merge-treehits a content conflict inpkg/template/examples_test.gobecause both PRs append a test at the same spot. Merge #103 first, rebase here, and keep both tests. - Option overlap in the new
typicalexample:env_or_logs(templates/swe/swe_issue_readiness.json.tmpl:33-35) still reads "Bug report lacks diagnostic error output (stack trace, error message, exit code)...", and the new example (templates/swe/swe_issue_readiness.examples.json:8) says "returns HTTP 200 with no error or crash". Literally speaking it lacks error output, so only the parenthetical inrepro_steps(:22) breaks the tie. Scopingenv_or_logsto failures where error output or runtime details exist but were left out (or adding a short precedence rule ininstructions) avoids relying on a parenthetical. foundAllloop (pkg/template/examples_test.go:253-260) stops at the first string field containing all three snippets. Check every replaced string key instead so one unescaped or dropped field cannot slip past.- Test scope and mutant check (
pkg/template/examples_test.go:190-210): Gotext/templatenever re-parses data values, so this checkstoJsonescaping across every string variable (including non-diff fields). Adding a control character ("\x07"),"\u2028", and a non-BMP rune ("😀") toadversarialPayloadalso catches{{ printf "%q" ... }}mistakes, which currently pass even though%qproduces invalid JSON escapes for control bytes.
3 tasks done
…r_logs and test JSX/Helm/control-char escaping Rebased cleanly onto merged GoogleCloudPlatform#103 (keeping both SWE template tests) and addressed review feedback: - Scope env_or_logs to failures that produce an error/crash or depend on environment state yet omit relevant diagnostics, and state precedence directly in missing_info_kind.instructions so HTTP 200 logic bugs map unambiguously to repro_steps. - Replace typical example in swe_issue_readiness.examples.json with clean HTTP 200 CSV logic bug missing only repro steps/inputs. - Add TestSWETemplatesRenderTemplateDelimitersInDiffs verifying every replaced string state field preserves JSX, Helm, Jinja, control byte (\x07), U+2028, and non-BMP emoji runes intact via toJson.
Collaborator
Author
|
Thanks @jigyasujuneja — rebased onto
Verified: |
ghchinoy
force-pushed
the
fix/swe-issue-readiness-and-braces-test
branch
from
December 2, 2026 15:55
53073ad to
4dbbdce
Compare
jigyasujuneja
approved these changes
Dec 2, 2026
jigyasujuneja
left a comment
Collaborator
There was a problem hiding this comment.
All four items from the previous pass are addressed cleanly:
- Rebased onto
mainafter #103 with bothTestSWETemplatesIncludeUntrustedDataGuardandTestSWETemplatesRenderTemplateDelimitersInDiffsintact. - Scoped
env_or_logsto failures with errors, crashes, or environment dependencies and added an explicit tie-break inmissing_info_kind.instructions. - Switched
TestSWETemplatesRenderTemplateDelimitersInDiffsto verify every replaced string key instateinstead of stopping on the first match. - Added
\x07,\u2028, and😀toadversarialPayloadto exercisetoJsonescaping beyondprintf "%q".
CI checks are green (7 passed, 5 skipped). Approved.
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.
Summary
Follow-up polish for
templates/swe/from #101:repro_stepsvs.env_or_logsonswe_issue_readiness:templates/swe/swe_issue_readiness.json.tmplsorepro_stepsexplicitly covers bug reports that identify the symptom/component but lack concrete steps or triggering inputs (even when environment details are present or no error is logged), whileenv_or_logstargets missing diagnostic error output or runtime/OS/config details.typicalexample intemplates/swe/swe_issue_readiness.examples.json(which previously includedError log:+ a 1-line panic message, pulling model predictions towardenv_or_logs) with a clean logic-bug ticket (Exported CSV in reports/export.go occasionally drops the last row, explicit component + Go/OS version + HTTP 200 / no crash) missing only triggering inputs and reproduction steps.{{ ... }}delimiter regression test:TestSWETemplatesRenderTemplateDelimitersInDiffsinpkg/template/examples_test.go, verifying all 8templates/swe/*.json.tmplsafely escape and preserve React JSX (style={{ color: "red", padding: 8 }}), Helm/Go template ({{ .Values.image.tag | default "latest" }}), and Jinja ({% if env == "prod" %}{{ user_input }}{% endif %}) payloads without template errors or JSON corruption.Surface & Documentation Checklist
docs/anddocs-site/are synced (no documentation changes).studio/dist/*) are included.Verification
go vet ./...go test -count=1 -race ./pkg/template/... ./cmd/...(including all 8 subtests ofTestSWETemplatesRenderTemplateDelimitersInDiffsandTestAllShippedTemplatesRenderAndValidate/swe/swe_issue_readiness)