Skip to content

test(prompts): store snapshot variants as deltas - #129295

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup-aug25-prompt-snapshot-deltas
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup-aug25-prompt-snapshot-deltas

Conversation

@steipete

@steipete steipete commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Store prompt snapshot variants as deterministic deltas instead of repeating each complete prompt fixture.
  • Materialize every full prompt from one canonical owner plus ordered variant edits.
  • Preserve the exact bytes and SHA-256 identity of all three current prompt variants.

Why

The snapshot suite repeated large prompt bodies whose differences are small and mechanically derivable. That representation made review and maintenance noisy while allowing shared text to drift independently. One deterministic materializer now owns reconstruction, ordering, and validation without changing runtime prompt generation.

Invariants

  • All three materialized prompt snapshots are byte-identical to the current contracts.
  • Delta application is deterministic and a second materialization is idempotent.
  • Prompt ordering, routing coverage, and snapshot ownership remain unchanged.
  • Production delta: zero lines.
  • Total reduction: 1,034 lines.

Verification

  • Snapshot generator/owner coverage: 16/16 passed.
  • Prompt routing and sibling coverage: 423/423 passed.
  • All three materialized prompt hashes match their reviewed current snapshots.
  • Formatting, typed lint, deterministic regeneration, idempotence, and diff checks passed.
  • Independent verification and mandatory local and committed-branch reviews completed without findings.

Surface

  • Exact thirteen test, fixture, and generator-owner files.
  • No runtime behavior, public API, provider routing, configuration, persistence, or prompt bytes change.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 11:58
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 10:51 PM ET / August 26, 2026, 02:51 UTC.

ClawSweeper review

What this changes

The PR replaces two repeated Codex prompt Markdown fixtures with SHA-bound unified-diff deltas materialized from the Telegram baseline during snapshot generation and checks.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No discrete correctness defect was established, but this maintainer-authored, protected PR remains for maintainer review; exact Codex and project-pinned diff dependency source were unavailable for the required contract pass.

Priority: P3
Reviewed head: c0c8ae00d84d8f71ab79d704a13844f8dcb71aaa

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has focused deterministic safeguards, but direct Codex and exact diff-contract evidence remains unavailable.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal fixture and generator refactor is outside the external-contributor real-behavior-proof gate.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal fixture and generator refactor is outside the external-contributor real-behavior-proof gate.
Evidence reviewed 5 items Delta owner: The generator creates zero-context, SHA-bound patches, validates their file names and hashes, applies them with no fuzz, and requires regenerated canonical output to match the committed delta.
Fixture coverage: Focused tests materialize each declared scenario, reject malformed or noncanonical deltas, and preserve the absent full variant files as an explicit fixture contract.
Current-main comparison: Current main still stores all three full Markdown snapshots and has no delta materializer, so this contribution is not already implemented there.
Findings None None.
Security None None.

Live Verification

Command: pnpm prompt:snapshots:check

Result: PASS (completed)

$ node --import tsx scripts/generate-prompt-snapshots.ts --check
Prompt snapshots are current (7 files).
$ node --import tsx scripts/generate-prompt-snapshots.ts --check
Prompt snapshots are current (7 files).

Assertions:

  • PASS expect_output: Prompt snapshots are current (

How this fits together

OpenClaw’s prompt-snapshot tooling records representative Codex app-server inputs for regression review. It generates scenario fixtures, materializes them for assertions, and routes fixture edits to the prompt-snapshot verification lane.

flowchart LR
  A[Codex prompt scenarios] --> B[Snapshot generator]
  B --> C[Telegram baseline fixture]
  C --> D[Scenario delta fixtures]
  D --> E[Materialized prompt snapshots]
  E --> F[Hash and snapshot checks]
  F --> G[Changed-file test routing]
Loading

Before merge

  • Resolve merge risk (P1) - Merging changes the snapshot-generation and changed-file-routing automation; the required exact Codex and project-pinned diff contract inspection could not be completed in this checkout.
  • Complete next step (P2) - No actionable patch defect was found; this maintainer-owned PR needs the remaining direct contract evidence rather than an automated repair.
Agent review details

Security

None.

PR surface

Tests -1184, Other +150. Total -1034 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 10 279 1463 -1184
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 154 4 +150
Total 13 433 1467 -1034

Review metrics

Metric Value Why it matters
Production versus test delta production 0; tooling, tests, and fixtures +433/-1,467 (net -1,034) The branch is behavior-neutral fixture maintenance; its substantial change is confined to generator/test support and committed review artifacts.

Stored data model

Persistent data-model change detected: vector/embedding metadata: test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/discord-group-codex-message-tool.md, vector/embedding metadata: test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-heartbeat-codex-tool.md. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete the snapshot contract pass (recommended)
    Inspect the project-pinned diff implementation and Codex source, then run the exact-head snapshot check to confirm all materialized variants remain byte-identical.
  2. Pause pending direct contract evidence
    Keep this PR in maintainer review until the unavailable dependency and Codex runtime evidence can be checked.

Technical review

Best possible solution:

Retain the single canonical fixture only after exact-head materialization proves all three prompt bytes remain identical and the Codex and diff contracts are inspected directly.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR refactors fixture representation rather than reporting a user-facing defect; the relevant verification is deterministic snapshot materialization.

Is this the best way to solve the issue?

Unclear: canonical SHA-bound deltas are a coherent representation, but the exact dependency and Codex runtime contracts required to call it the best solution could not be inspected locally.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b611914e0d75.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P3: This is low-risk test-fixture and automation maintenance with no intended runtime behavior change.
  • merge-risk: 🚨 automation: The PR changes snapshot generation, committed-artifact cleanup, and changed-file test routing, so an incorrect materializer could degrade CI verification.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal fixture and generator refactor is outside the external-contributor real-behavior-proof gate.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main history and blame attribute the prompt snapshot owner and prior fixture-deduplication work to Peter Steinberger. (role: prompt snapshot feature owner and recent area contributor; confidence: high; commits: 4a029e5279a4, faaeebe20847; files: scripts/generate-prompt-snapshots.ts, test/helpers/agents/happy-path-prompt-snapshots.ts, test/scripts/prompt-snapshots.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Inspect the sibling Codex source and the project-pinned diff package before treating the fixture assertions as contract-complete.
  • Run the exact-head prompt snapshot check and retain its materialization output as maintainer evidence.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-25T12:04:21.424Z sha ca6e7bf :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T12:26:20.888Z sha ca6e7bf :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T12:56:33.222Z sha 4f41f79 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 25, 2026
@steipete
steipete force-pushed the codex/cleanup-aug25-prompt-snapshot-deltas branch from 4f41f79 to c0c8ae0 Compare August 26, 2026 02:44
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 26, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The remaining ClawSweeper contract-evidence item is complete on the exact reviewed head.

Direct Codex inspection covered the collaboration-mode and prompt-state owners at sibling Codex commit 6677fd827d2c: app-server-protocol/src/protocol/v2/turn.rs:148-155, app-server/src/request_processors/turn_processor.rs:355-370,699-700, core/src/session/world_state.rs:191-194, and core/src/context/world_state/collaboration_mode.rs:20-41,79-95. Those paths confirm that missing developer instructions resolve through the selected built-in collaboration mode and that the world-state owner emits only the changed fragment. Config warning behavior was also checked at config/src/config_toml.rs:458-459, core/src/config/mod.rs:4289-4291, features/src/lib.rs:1530-1576, and core/src/session/session.rs:940-948.

The repository pins diff 9.0.0. Its installed source was inspected directly: libesm/patch/create.js:83-116,294-327 owns exact file headers, zero-context hunks, deterministic ordering, and the terminal LF; parse.js:14-15,31-38,175-190 owns unified-patch parsing; and apply.js:27-56,177-221 owns single-patch exact application and failure. OpenClaw additionally requires one closed-file patch, source/target SHA-256 headers, fuzzFactor: 0, and disabled line-ending conversion at scripts/generate-prompt-snapshots.ts:60-121.

Exact materialization was regenerated, checked, regenerated a second time with an unchanged full diff, and verified byte-for-byte. The three resulting SHA-256 values are:

  • telegram-direct: 0a75703590d0c2198fdadbf2e427bd7f3242ebfb7d10ae339585e17f566be58c
  • discord-group: 4f7a8ee79c437a370ba71c39e53ae27d1f84ad4e11fe9528b7ae708ec5c4a21b
  • heartbeat-turn: 31b09c09f2f9f3489cd4ef29b368dfd5390708ab9fa320edc3ccfb73d8a1f06b

These match the reviewed fresh-main artifacts. Owner coverage passed 16/16, routing coverage passed 423/423, and the package patch guard, typed lint, formatting, and exact-head CI are green.

@steipete
steipete merged commit c406ef4 into main Aug 26, 2026
126 checks passed
@steipete
steipete deleted the codex/cleanup-aug25-prompt-snapshot-deltas branch August 26, 2026 03:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant