Repository navigation
Trace HTMLを副作用なし・出力上限付きで生成する - #184
Merged
Merged
Conversation
Collaborator
Author
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
変更内容
Trace HTMLの保存前に容量を判定するため、呼び出し側でGuaのHTML/CSP/JSON生成を複製する必要があった。
RenderHtml(GuaTraceReadResult trace, int maxOutputBytes)を追加し、検査済みの同一snapshotから副作用なしで完全なUTF-8 HTMLを返す。固定Viewerの公開テキストは実データの秘密検査対象に含めず、安全な埋め込みはGuaが担当する。report-limit、非正の上限はinvalid-output-limit。失敗時は常にUtf8Html=null。WriteHtml(directory,path)は共通rendererを使用し、既存signature・create-only保存・error契約を維持。Closes #183
契約と検証の対応
対象commit:
3183767acb90efd87f04505fe9f57267fee48821。Windows x64 / .NET SDK 10.0.401 / MSVC19.51 / Bun1.4.0(lockfile固定)。TraceReportTests.NonpositiveLimitReturnsExplicitFailureWithoutOutput/ExactUtf8BoundaryAndSafeEmbeddingRoundTrip: bytes同一、Succeeded/Error/Utf8Htmlを検査LegacyWriterUsesIdenticalRendererAndDoesNotOverwrite: render後の出力親なし、保存bytes一致、再保存失敗と旧bytes保持InvalidSnapshotDoesNotExposePartialOutput: Undefined JsonElementでreport-failed、bytes=null違反検出証拠: 出力capガードのみを提出対象外の一時変異で無効化した。boundary testの
Assert.That(shortResult.Succeeded, Is.False)が実際Trueで失敗した(TraceReportTests.cs:41)。finallyで元ソースへ復元し、関連回帰を再実行。無関係な環境失敗ではない。実行:
bun install --frozen-lockfile/bun run --filter @gua/inspector build:trace: 成功(実React bundleを使用)。dotnet test bindings/dotnet/tests/Gua.Visual.Tests/Gua.Visual.Tests.csproj --no-restore --filter FullyQualifiedName~TraceReportTests: 5 passed / 0 skipped。TraceTests|TraceReportTests|TraceStorageTests: 97 passed / 0 skipped。dotnet build bindings/dotnet/src/Gua.Testing/Gua.Testing.csproj --no-restore --configuration Release: net10.0/netstandard2.1、0 warnings / 0 errors。gua_auditor独立read-only監査: .NET/Trace/Inspector埋め込みを確認、actionable findingなし。追加監査ループなし。確認範囲・配布
出力buffer capacityはcap以下、成功時にexact byte[]を1個追加copyする。capはtotal heap上限ではない。入力snapshot・固定Viewer・serializer buffer(最大encoded tokenを含む)は別途メモリを使い、readerの入力/件数/record上限を呼び出し側で設定する。新APIはディスクI/O/キャンセルを持たず、保存時のI/O・キャンセル分類は呼び出し側が担当する。legacy保存失敗時の部分ファイルcleanupは従来契約を変更していない。
最終headのCIは18/18件すべて成功。実Codex review(gpt-5.6-sol/max/read-only)は完了し、origin/mainからの累積差分でactionable findingなし。最終headのRelease関連回帰97件は0 failed/0 skipped。commit刻印付きローカルnupkgの隔離consumer確認は合格(以下参照)。ローカル候補は正式公開版ではない。mainマージ・tag/release・NuGet公開は行わない。Playtest側PRは別担当がこのAPIに合わせて変更する。
ローカルpackage候補の検証
正式未公開の候補version:
1.1.2-preview.playtest.3183767。Gua.Testingと依存Gua.Coreを同versionでpackし、project参照なし・独立NuGet cacheのnet10.0 console consumerへrestoreした。実Trace生成(2 events)→bounded reader→RenderHtml→正確な212986 bytes cap成功→212985 bytes capのreport-limit/null→create-only保存bytes一致→同梱Viewer sourceCommit一致がすべて合格。dotnet pack bindings/dotnet/src/Gua.Testing/Gua.Testing.csproj --configuration Release -p:GuaPackageVersion=1.1.2-preview.playtest.3183767 -p:RepositoryCommit=3183767acb90efd87f04505fe9f57267fee48821(依存Gua.Coreも同versionでpack)Gua.Testing.1.1.2-preview.playtest.3183767.nupkgSHA256:1A235F10228BA3EDAFEEF03B3A02AE520DA015AA4034A904D7480D9A4AF78E5DGua.Distribution.Viewer.version.jsonsourceCommitはhead SHAに一致。sNphQgB3n06Oa5WvOXQScD4rFM88d1uvkFeSZ6s/QNA=。C:\Users\testk\Documents\Codex\2026-10-26\task\gua\artifacts\packages。隔離consumer source/configは隣のgua-package-smoke、TRXはbindings/dotnet/tests/Gua.Visual.Tests/TestResults/trace-report-final-head.trx。APIの安全な埋め込み・出力capは候補packageで確認済みだが、公開package経由のPlaytest最終CIを代替しない。mainマージはユーザーが実施する。
CLI Codex review(GitHub PRレビューとは別)
codex review --uncommitted -c model="gpt-5.6-sol" -c model_reasoning_effort="max" -c sandbox_mode="read-only"、exit 0。review実行中に対象変更をcommitしたため、reviewerはclean treeを確認した上でorigin/mainからの累積branch差分3filesを読み直し、Trace renderer/legacy writer契約とbuilt assemblyの境界/errorテストを確認した。最終所見: “No actionable defect was found, and the focused Trace report tests passed.” この実行でsource変更なし。初回の既定gpt-6.1-sol CLI起動はaccount/model非対応で失敗し、レビュー成立として数えていない。リポジトリ監査script指定のgpt-5.6-solで上記レビューを完了した。
最終head CI(18/18成功・完了)
Syntax Check run 40274039959、head
3183767acb90efd87f04505fe9f57267fee48821。完了済みC# jobの実ログでGua.Visual.Tests全378 passed / 0 failed / 0 skipped、Gua.Snapshots.Tests32 passed / 0 failed / 0 skippedを確認。C++、TypeScript、version metadata、4 OS native bridge、native NuGet契約、4 OS package-only smokeも成功。Godot Web Debug/Releaseと4 OS desktopの実行確認もすべて成功し、run全体がcompleted/successになった。
GitHub PR Codex review(最終headで完了)
最終headへのレビュー依頼を
@codex reviewで送信し、GitHub Codex Review Summaryが2026-10-26 05:37:27 UTCに完了した。構造化状態はcommit_sha=3183767acb90efd87f04505fe9f57267fee48821、status=completed、has_any_findings=false、has_unresolved_findings=false。inline review commentsも空であり、明示的な完了状態と対象SHAを確認済み。CLIレビューとは別に成立したGitHub PRレビューの証拠であり、コメント不在だけをcleanレビューとしていない。ready切替後もunmergedを維持する。bridge有効のconsumer候補(ws1)
Playtest側の独立consumerで、最初の候補のHTML/保存は成功したが、既存native transport caseがTrace呼出し前の
StartInspectorBridgeで失敗した。原因はこの作業で最小nativeを構成した際のGUA_BUILD_WS_BRIDGE=OFFであり、legacy Windows pack方式そのものの制限ではない。native/gua-runtime/CMakeLists.txt:35-40がGUA_RUNTIME_WITH_WS=0を設定し、runtime.cpp:1640-1645は開始要求に0を返す。通常の4RID release/CI configureはこのOFF設定を使わず、desktop既定ONでbridgeを組み込む。既存候補のhashを変えず、同一source headの別候補
1.1.2-preview.playtest.3183767.ws1をartifacts/packages-wsへ作成した。Core/Testing/Runtime/Testing.Recordingの4package。CMake実cacheはGUA_BUILD_WS_BRIDGE=ON、GUA_BUILD_ID=3183767acb90efd87f04505fe9f57267fee48821、GUA_VERSION=1.1.2-preview.playtest.3183767.ws1。別cacheのpackage-only net10.0 consumerで、元のHTML完全一致/1byte不足/provenance/保存検証に加え、実native
StartInspectorBridge → InspectorBridgeRunning → StopInspectorBridge → !InspectorBridgeRunningが成功した。これはbridge起動停止の証拠であり、Playtestの全Recording roundtripの代替ではない。製品ソース変更・head更新はない。Gua.Testingnupkg SHA256:3406A9F2E67774AD988D6BAD2E9063DF5A99474E7DDD2FA2F51DCDBC0545B0D3Gua.Runtimenupkg SHA256:B7E1FC10F7D289DE06D3A958A4FAD4FEAC0F58FC8E1E8BC2AA55577ADC7D4AF6Gua.Corenupkg SHA256:2B0FF94938A5BF57847137296B94AC0C430CB7ABD68942B9961AA43DC4692AABGua.Testing.Recordingnupkg SHA256:A42D98B89A32599E2FE2D39915050FC41AA71836C97F3989B05E965E0B9521D7ws1もローカルWindows候補であり、正式公開版/4RID配布を意味しない。Playtestの正式pinは公開版のまま保持する。
最終確認
3183767acb90efd87f04505fe9f57267fee48821。status=completed、conclusion=success、18 jobsすべてsuccess(skip/cancel/failureなし)。PR statusCheckRollupも18件すべてSUCCESS。OPEN/isDraft=false/MERGEABLE(ready切替後の同head再レビューも完了)、local git statusはclean。main merge、auto-merge、tag/release、registry/package publicationは行っていない。手動マージ引き継ぎ(ready後の再レビューも完了)
親スレッドからの明示指示でPRをreadyへ切り替えた。headは
3183767acb90efd87f04505fe9f57267fee48821のまま、18件のCIは全SUCCESS、source treeはclean。readyイベントによる新しいGitHub Codexレビューは05:59:46 UTC開始、06:00:54 UTCに完了。同じfull SHAでstatus=completed、has_any_findings=false、has_unresolved_findings=false、inline指摘なしを再確認した。最新レビュー状態のtriggerはDraft marked ready。以前のmanual reviewはreceiptにも残っている。PRの最終状態はOPEN / isDraft=false / MERGEABLE / mergedAt=null / autoMergeRequest=null。手動マージの引き継ぎ条件が揃った。GitHub Releaseの最新tagとNuGet Gua.Testingの最新公開版はいずれも1.1.1。新しいpublic APIを互換追加するため、次の正式版はminor版
1.2.0を推奨する。これは推奨であって、版の確定・公開の承認ではない。1.1.2-preview.playtest.*はローカル候補の識別子であり、正式な次版を予約しない。正式配布の最小手順は、(1) ユーザーが本PRをmainへマージ、(2) 別途明示承認された正式versionでマージ後のmainに
gua-vX.Y.Ztagを作成/pushし、通常workflowの4RID native→pack→4RID package smoke→NuGet publishを完了、(3) 公開APIの取得確認後にPlaytestの正式pinを更新して最終CIを実行、となる。tagはNuGet Publish・Gua Release・MCP npm Publishの3workflowを起動するため、NuGetだけの無害な準備操作とは扱わない。release環境の承認が必要な場合はrelease担当が対応する。tag/push、公開、merge/auto-mergeはいずれも本作業では行わない。