Skip to content

refactor(skills): consolidate workshop transcript and record normalization - #119643

Merged
steipete merged 1 commit into
mainfrom
codex/loc-0805-normalization-dmvazq
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/loc-0805-normalization-dmvazq

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Skills research autocapture, live workshop review, and historical scanning independently selected the current user turn and counted assistant/model iterations. Workshop state, proposal provenance, and persisted proposal/rollback records separately implemented record guards, JSON parsing, metadata normalization, and invalid-record errors.

Why This Change Was Made

Make the existing workshop transcript owner canonical for current-turn selection and model-iteration counting. Reuse the existing public normalization-core record, string, and JSON helpers across lifecycle, provenance, and persistence boundaries; preserve hostile-array rejection, originating-run validation, mutation-replay suppression, and persisted proposal/rollback discriminators while removing connected duplicate paths.

User Impact

Research autocapture, experience review, history scanning/resume, evaluation/auto-apply, lifecycle hooks, provenance checks, and persisted rollback retain their existing behavior. Model-visible transcript and prompt bytes remain unchanged, with no additional or unbounded model context. Nine production files change by +87/-158 (71 fewer production lines); there are no test, config, schema, package-export, or public API changes.

Evidence

  • Exact before/after transpiled-production-source differential proof: 10,822 comparisons, comprising 9,001 current-turn selection, assistant/model counts, transcript rendering, and prompt-byte vectors plus 1,821 hostile record/array, provenance, replay suppression, JSON, and persisted proposal/rollback vectors.
  • One trusted Blacksmith Testbox lease (tbx_01kz92zzzprgzcbhk4qz5wcwng): 14 focused suites, 172 tests passed, covering lifecycle, research autocapture/auto-apply, experience review/auto-apply, history scan/resume, record/store persistence, service/evaluation/lifecycle, and prompt authoring.
  • Full unchanged remote pnpm check:changed passed on the same lease, including core and core-test typechecks, formatting, lint, plugin boundaries, all three dead-export scans, database/schema guards, and zero runtime import cycles: https://github.com/openclaw/openclaw/actions/runs/31012107778
  • Independent structured autoreview using Codex gpt-5.6-sol with xhigh reasoning: clean, confidence 0.97; no actionable findings.
  • Scoped canonical formatting, strict generic/result-type semantic checks, and git diff --check passed; the sole owned Testbox lease was stopped and independently verified completed.
  • AI-assisted implementation and independent review.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete
steipete marked this pull request as ready for review August 5, 2026 14:09
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 5, 2026, 10:16 AM ET / 14:16 UTC.

ClawSweeper review

What this changes

This PR centralizes skills-workshop current-turn selection, model-iteration counting, and record/JSON normalization while removing equivalent local implementations.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer handling: the protected maintainer label prevents automated cleanup, and the exact head has no actionable correctness or security finding.

Priority: P3
Reviewed head: 9427852bba04dbe52429fd7f21cc0286776d3ca6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a clean, behavior-preserving consolidation with strong source and contract support and no actionable finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled internal refactor is outside the external-contributor real-behavior-proof gate; the PR body additionally reports focused remote validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labeled internal refactor is outside the external-contributor real-behavior-proof gate; the PR body additionally reports focused remote validation.
Evidence reviewed 5 items Exact PR surface: The commit-parent diff is limited to nine production skills files and is net-negative; it replaces duplicate helpers with shared workshop helpers without configuration, schema, API, dependency, or CI changes.
Normalization contract: The shared record guard rejects null and arrays exactly as each replaced guard did; the JSON and optional-string helpers retain the previous parser and trim semantics, and their imports use declared package exports.
Caller and sibling coverage: Autocapture still scopes replay suppression to the current turn, experience review still prefers harness-reported iterations, and history scan counts filtered history before taking its bounded tail; existing tests cover those invariants and persisted record discriminators.
Findings None None.
Security None None.

How this fits together

Skills Workshop consumes agent transcripts to create research suggestions, schedule experience reviews, and scan historical sessions. It also validates persisted proposal and rollback records before the workshop uses them.

flowchart LR
  A[Agent transcript] --> B[Turn and iteration normalization]
  B --> C[Research autocapture]
  B --> D[Experience review]
  A --> E[History scan filtering]
  F[Stored workshop row] --> G[Record and JSON normalization]
  G --> H[Validated proposal state]
Loading

Before merge

  • Add real behavior proof - Not applicable: This maintainer-labeled internal refactor is outside the external-contributor real-behavior-proof gate; the PR body additionally reports focused remote validation.
  • Complete next step (P2) - No discrete repair is needed; the protected maintainer label leaves this PR to normal human review and exact-head CI.
Agent review details

Security

None.

PR surface

Source -71. Total -71 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 9 87 158 -71
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 87 158 -71

Review metrics

Metric Value Why it matters
Production versus test delta production +87/-158 (net -71); tests +0/-0 The refactor reduces production duplication without adding a new test or configuration surface.

Stored data model

Persistent data-model change detected: serialized state: src/skills/workshop/history-scan-state.ts, serialized state: src/skills/workshop/history-scan-transcript-content.ts, serialized state: src/skills/workshop/store-sqlite-record.ts, unknown-data-model-change: src/skills/workshop/history-scan-transcript-content.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one canonical transcript and normalization path, then land this net-negative refactor once exact-head CI and normal maintainer review complete.

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

Not applicable: this PR is a behavior-preserving refactor, and source inspection shows the substituted helpers retain the prior semantics.

Is this the best way to solve the issue?

Yes: locating the shared transcript helpers with their rendering owner removes duplicated policy while callers retain their distinct capture, review, and history boundaries.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a behavior-preserving internal cleanup with no demonstrated user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled internal refactor is outside the external-contributor real-behavior-proof gate; the PR body additionally reports focused remote validation.

Label justifications:

  • P3: This is a behavior-preserving internal cleanup with no demonstrated user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-labeled internal refactor is outside the external-contributor real-behavior-proof gate; the PR body additionally reports focused remote validation.

Evidence

What I checked:

  • Exact PR surface: The commit-parent diff is limited to nine production skills files and is net-negative; it replaces duplicate helpers with shared workshop helpers without configuration, schema, API, dependency, or CI changes. (src/skills/workshop/experience-review-prompt.ts:22, 9427852bba04)
  • Normalization contract: The shared record guard rejects null and arrays exactly as each replaced guard did; the JSON and optional-string helpers retain the previous parser and trim semantics, and their imports use declared package exports. (packages/normalization-core/src/record-coerce.ts:2, 9427852bba04)
  • Caller and sibling coverage: Autocapture still scopes replay suppression to the current turn, experience review still prefers harness-reported iterations, and history scan counts filtered history before taking its bounded tail; existing tests cover those invariants and persisted record discriminators. (src/skills/research/autocapture.ts:218, 9427852bba04)
  • Current-main comparison: The PR head is not contained in supplied current main, and current main has not changed any of the nine affected paths since the actual merge base; the cleanup remains distinct work. (src/skills/workshop/experience-review.ts:317, acc31c3af3b1)
  • Feature-history provenance: Workshop experience-review ownership appears to date to Peter Steinberger's interrupted-turn feature commit; the shared helper lines are attributable to this PR head. (src/skills/workshop/experience-review-prompt.ts:22, 095f30ae269d)

Likely related people:

  • steipete: Introduced the recent experience-review path and authored the canonical helper consolidation. (role: recent skills-workshop owner; confidence: high; commits: 095f30ae269d, dc93ea6d699a, 9427852bba04; files: src/skills/workshop/experience-review-prompt.ts, src/skills/workshop/experience-review.ts, src/skills/research/autocapture.ts)
  • Vincent Koc: Recent history shows centralization and privacy work on the persisted workshop record-validation surface. (role: workshop record-validation contributor; confidence: medium; commits: eea4937d5be5, 8ee8bde257de; files: src/skills/workshop/store-record.ts, src/skills/workshop/store-sqlite-record.ts)

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.

@steipete
steipete merged commit 412a1a3 into main Aug 5, 2026
187 checks passed
@steipete
steipete deleted the codex/loc-0805-normalization-dmvazq branch August 5, 2026 17:26
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
…cope

* origin/main: (70 commits)
  fix(clickclack): preserve MIME extension for unnamed uploads (openclaw#119646)
  fix(memory): keep post-ready RPCs responsive (openclaw#119710)
  fix(browser): preserve locale, timezone, and device overrides (openclaw#119695)
  fix(agents): stop messaging dedupe from dropping final replies that quote a short tool send (openclaw#118178)
  test(agents): batch code mode budget proof (openclaw#119699)
  fix(memory): keep gateway RPCs responsive during startup (openclaw#119676)
  improve(ui): trail transient session status beside row actions (openclaw#119560)
  refactor(msteams): consolidate channel action target resolution (openclaw#119632)
  fix: tail context answers the current user message (openclaw#117364)
  fix(whatsapp): exercise descriptor-safe credential persistence (openclaw#119621)
  fix(diagnostics-otel): route OTLP endpoints by signal (openclaw#101655)
  refactor(skills): consolidate workshop transcript and record normalization (openclaw#119643)
  fix(video): harden DashScope task and media lifecycle (openclaw#117303)
  refactor(transcripts): consolidate persistence and export ownership (openclaw#119634)
  fix: preserve ClickClack discussion state contracts (openclaw#118851)
  fix(matrix): retire shared E2EE clients safely (openclaw#119570)
  refactor(cron): unify catch-up persistence and payload encoding (openclaw#119636)
  refactor(ui): centralize composer attachment and capability controls (openclaw#119650)
  refactor(daemon): consolidate managed service lifecycle ownership (openclaw#119647)
  fix(browser): honor explicit navigation timeouts across browser drivers (openclaw#119654)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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