Skip to content

refactor: keep Knowledge scribe run prompt private - #186347

Merged
shakkernerd merged 1 commit into
mainfrom
knowledge-scribe-private-prompt
Oct 27, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
knowledge-scribe-private-prompt

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

What Problem This Solves

Knowledge's runPrompt helper is used by production only inside the scribe catalog, but it is exported so one test can call it directly. That unnecessary implementation export is reported by the repository's unused-export check, and the direct test import bypasses the public prompt output that actually carries the scheduled payload.

User Impact

There is no user-visible behavior change. Generated setup, repair, and scheduled-run prompt bytes remain unchanged, including private-access checks, unattended-run guidance, schedules, failure handling, and status instructions. The Knowledge plugin, package, and Plugin SDK surfaces are unchanged.

Why This Change Was Made

This change makes runPrompt module-private while retaining its existing production callers. The catalog test now extracts the fenced run message from setupPrompt, the real public owner of the generated ongoing-scribe payload, and checks the run-specific settings and automation restrictions on that extracted message rather than importing the private constructor.

Evidence

  • Scheduled check-dependencies evidence identified runPrompt as the remaining unnecessary production export.
  • Current-source inspection found only the two same-module production calls and the removed test-only import; package and plugin entrypoints do not expose the helper.
  • Remote changed-file formatting and extension lint passed on the exact committed tree.
  • The exact-base test-line ratchet passed with 2 lines of remaining slack; the script, production, and full-tree unused-export scans each reported zero entries.
  • The affected extensions and extensions-test type graphs passed.
  • scribes-state.test.ts and scribes-view.test.ts passed all 31 tests.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@shakkernerd shakkernerd self-assigned this Oct 27, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes the Knowledge scribe run-prompt helper private and tests its output through the setup prompt.

Example: Start an ongoing conversations scribe covering active and archived conversations from the last 90 days.

  • Before: The test imports runPrompt directly to inspect the scheduled message.
  • After: The test extracts that message from setupPrompt; the operator receives the same prompt.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, correct cleanup with stronger boundary assertions and no identified defect; remaining exact-head CI is pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored refactor changes module visibility and test access only; production prompt construction is unchanged, and the body reports focused tests and static checks rather than a new live scenario.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction removes a test-only implementation export, follows the plugin-private boundary, and preserves the existing editable-prompt contract.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused, behavior-preserving cleanup that remains applicable on current main; no actionable defect was found.

Priority: P3
Reviewed head: 035e16e3baeb04b71ab6e71f7d160cfc85fc1b4f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Knowledge scribe catalog turns dialog choices into setup and repair prompts containing the message installed on a scheduled automation.

flowchart LR
  A[Dialog choices] --> B[Setup prompt]
  C[Existing automation] --> D[Repair prompt]
  E[Private run prompt helper] --> B
  E --> D
  B --> F[Scribe conversation]
  D --> F
  F --> G[Scheduled automation]
Loading

Technical review

Best possible solution:

Keep runPrompt module-private and retain independent assertions on the scheduled message emitted by setupPrompt.

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

No user-facing bug is claimed; source inspection confirms the test-only external use of the helper, and the prior merged cleanup records the unused-export finding.

Is this the best way to solve the issue?

Yes: removing the unnecessary export and inspecting the existing setup output is the smallest complete change, without another owner, wrapper, or compatibility path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2229c93b0a4e.

Provenance checked

  • Scribe run-prompt construction and catalog assertions keeps the original intent (ed23336: The prior feature made setup, run, and repair prompts readable and editable, with scheduled work settings carried in the automation message.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Pinned diff, callers, provenance, and current main: The introduced production hunk removes only export from runPrompt; its setupPrompt and repairPrompt callers remain in the same module. Repository-wide references show no remaining external consumer of this Knowledge helper. The test inspects the fenced setup payload and preserves independent settings assertions while checking that scheduled runs contain no automation-setup instruction. The pinned main comparison contains no changes to either touched file. feat(knowledge): readable scribe prompts the operator can edit #185974 explains the readable, editable prompt contract, which this PR preserves. fix(ci): dependency validation fails on scribe schedule formatter #186145 independently records runPrompt as an outstanding unused export after its separate scheduleLine cleanup. Live REST reads confirmed the reviewed head, MEMBER association, mergeable status, and pending CI without reported failed checks. Root and extensions policies were read; no deeper AGENTS.md or maintainer-notes directory was present. A follow-history read eventually encountered an unavailable historical object; the relevant prompt-introduction commit and current source were available. (extensions/knowledge/src/scribes-catalog.ts:249, 035e16e3baeb)

Likely related people:

  • Josh Lehman: Raw commit ed23336 adds extensions/knowledge/src/scribes-catalog.ts:253 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ed2333640513; files: extensions/knowledge/src/scribes-catalog.ts)

PR surface

Source 0, Tests +1. Total +1 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 4 3 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 5 4 +1

Labels

Label changes:

  • add P3: This is a low-risk internal export and test-boundary cleanup with unchanged user behavior.
  • 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.

Label justifications:

  • P3: This is a low-risk internal export and test-boundary cleanup with unchanged user behavior.
  • 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.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 6:04 PM ET / 22:04 UTC.

@shakkernerd
shakkernerd merged commit ba786d0 into main Oct 27, 2026
100 of 103 checks passed
@shakkernerd
shakkernerd deleted the knowledge-scribe-private-prompt branch October 27, 2026 22:23
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Simplified: The Knowledge scribe's scheduled run prompt constructor is now private while public prompt-output coverage remains intact.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
Keep the Knowledge scribe's scheduled run prompt constructor private while preserving public prompt-output coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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