Skip to content

fix(secrets): generate secretref reference docs from the credential matrix - #89142

Closed
1052326311 wants to merge 1 commit into
openclaw:mainfrom
1052326311:fix/secretref-docs-generate-markdown-v2
Closed

1052326311 wants to merge 1 commit into
openclaw:mainfrom
1052326311:fix/secretref-docs-generate-markdown-v2

Conversation

@1052326311

@1052326311 1052326311 commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #85969 (replaces the original PR). Adds a shared SecretRef credential-surface Markdown formatter, extends the matrix generator with write/check modes for JSON plus Markdown marker blocks, wires package/preflight scripts, updates generated reference docs, and adds formatter/drift tests.

Changes from original PR

  • Removed CHANGELOG.md change — release-owned file
  • Cross-platform scripts — wrapped check:secretref-docs and gen:secretref-docs with node scripts/run-with-env.mjs instead of POSIX env assignment
  • Rebased onto latest main — clean cherry-pick

Behavior or issue addressed: SecretRef credential matrix and credential-surface docs regenerate cleanly on macOS without POSIX env syntax.

Real environment tested: macOS 26.6 (Darwin arm64), Node v22.22.0, OpenClaw source checkout at 8c6e99e82

Exact steps or command run after this patch:

# Generate JSON matrix + Markdown docs (live macOS run)
pnpm gen:secretref-docs

# Verify docs are in sync (--check mode)
pnpm check:secretref-docs

# Run unit tests for formatter and drift checks
npx tsx node_modules/vitest/vitest.mjs run src/secrets/credential-matrix-docs.test.ts
npx tsx node_modules/vitest/vitest.mjs run src/secrets/target-registry.docs.test.ts

Evidence after fix:

Live macOS generation output:

$ pnpm gen:secretref-docs
Wrote docs/reference/secretref-user-supplied-credentials-matrix.json
Updated marker blocks in docs/reference/secretref-credential-surface.md

check:secretref-docs confirms no drift:

$ pnpm check:secretref-docs
secretref reference docs are in sync.

Generated artifacts (live run, actual output):

File Lines Contents
secretref-user-supplied-credentials-matrix.json 428 57 entries
secretref-credential-surface.md 126 66 config paths documented

Test suite all pass:

 ✓ matrix JSON matches generator output
 ✓ credential-surface marker blocks match generator output
 ✓ matrix and credential-surface marker blocks describe the same registry shape

 Test Files  2 passed (2)
      Tests  13 passed (13)

Observed result after fix: Both generation and verification work cross-platform on macOS. No POSIX env assignment required. Matrix generation is idempotent (second run shows 'already in sync').

What was not tested: Windows and Linux behavior (CI covers these).

@clawsweeper re-review

@1052326311
1052326311 requested a review from a team as a code owner June 1, 2026 16:15
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 27, 2026, 8:29 AM ET / 12:29 UTC.

Summary
The PR extends the SecretRef credential-matrix generator to write/check Markdown marker blocks, adds formatter and drift tests, updates generated docs, and wires gen/check scripts into package/preflight tooling.

PR surface: Source +124, Tests +213, Docs 0, Config +2, Other +60. Total +399 across 10 files.

Reproducibility: yes. Source inspection on current main and v2026.6.10 shows the generator writes only the JSON matrix while the Markdown credential-surface page is checked after the fact instead of generated.

Review metrics: 1 noteworthy metric.

  • Generated-doc automation: 2 package scripts added, 1 preflight check added. The PR changes contributor-facing verification behavior, so maintainers should notice the new SecretRef generated-reference gate before merge.

Stored data model
Persistent data-model change detected: serialized state: scripts/generate-secretref-credential-matrix.ts, serialized state: src/secrets/target-registry.docs.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #44289
Summary: The canonical issue tracks generating SecretRef reference docs from registry metadata; this PR is a candidate fix, with one overlapping open candidate and one closed predecessor.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Resolve the conflict and regenerate SecretRef docs on current main.
  • Rerun pnpm check:secretref-docs and the focused SecretRef docs tests after refresh.

Risk before merge

  • [P1] Live GitHub reports the branch as DIRTY/CONFLICTING, so it needs conflict resolution, regeneration, and proof on current main before merge.
  • [P1] The diff adds SecretRef generated-doc verification to the normal preflight graph, so maintainers should deliberately accept that stale generated reference artifacts will fail future contributor checks.
  • [P1] docs(secrets): generate secretref reference docs from target registry metadata #91612 targets the same canonical issue, so maintainers should keep one implementation path rather than merging competing generators.

Maintainer options:

  1. Refresh and prove the generated-doc gate (recommended)
    Resolve the conflict, regenerate the SecretRef artifacts on current main, and rerun the new check plus focused docs tests before merge.
  2. Accept the preflight gate deliberately
    Maintainers can accept that stale SecretRef reference artifacts will fail normal preflight checks once this refreshed branch lands.
  3. Pause the competing generator branch
    After selecting one canonical implementation, keep the overlapping sibling PR from becoming a second generator path for the same artifacts.

Next step before merge

  • [P2] Manual review is needed because the branch is currently conflicting and maintainers need to choose one canonical implementation path between overlapping PRs.

Security
Cleared: No concrete security or supply-chain regression was found; the live diff changes SecretRef docs generation, tests, and package script wiring without lockfile, dependency-source, workflow, permission, or runtime secret-resolution changes.

Review details

Best possible solution:

Refresh this branch on current main and land one canonical generator/check implementation that extends the existing SecretRef matrix generator, preserves the credential-surface doc structure, and proves the new gate after regeneration.

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

Yes. Source inspection on current main and v2026.6.10 shows the generator writes only the JSON matrix while the Markdown credential-surface page is checked after the fact instead of generated.

Is this the best way to solve the issue?

Yes after refresh. Extending the existing registry-backed SecretRef matrix generator and sharing a pure formatter with the drift test is the narrow maintainable solution; the branch still needs conflict resolution and regeneration on current main.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded docs/tooling reliability PR with limited runtime blast radius but real merge-readiness work remaining.
  • merge-risk: 🚨 automation: The diff adds SecretRef generated-doc package scripts and a preflight check that can fail future branches when generated reference docs drift.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied live macOS terminal output for generation, check mode, and focused formatter/drift tests after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied live macOS terminal output for generation, check mode, and focused formatter/drift tests after the fix.
Evidence reviewed

PR surface:

Source +124, Tests +213, Docs 0, Config +2, Other +60. Total +399 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 2 125 1 +124
Tests 3 256 43 +213
Docs 1 68 68 0
Config 1 2 0 +2
Generated 0 0 0 0
Other 3 64 4 +60
Total 10 515 116 +399

What I checked:

  • Repository policy applied: Root AGENTS.md plus docs, scripts, and test scoped guides were read; the generated-artifact generator/check-pair guidance and high-confidence PR review guidance apply to this docs/tooling change. (AGENTS.md:1, c5d34c8376f8)
  • Current main generator gap: Current main's SecretRef generator builds the credential matrix and writes only docs/reference/secretref-user-supplied-credentials-matrix.json; it has no Markdown marker-block writer or check mode. (scripts/generate-secretref-credential-matrix.ts:13, c5d34c8376f8)
  • Current main checks Markdown after the fact: The current docs test reads docs/reference/secretref-credential-surface.md marker blocks and compares them to the matrix, proving the Markdown surface is drift-checked rather than regenerated. (src/secrets/target-registry.docs.test.ts:52, c5d34c8376f8)
  • PR implementation shape: The PR imports a new formatter into the existing generator, adds --check drift failures for JSON and Markdown, and writes the Markdown marker blocks when not in check mode. (scripts/generate-secretref-credential-matrix.ts:45, 75a0f14e2ea4)
  • PR preserves docs structure through formatter: The new formatter keeps openclaw.json entries separate from auth-profiles.json entries and preserves the sibling-ref compatibility wording. (src/secrets/credential-matrix-docs.ts:46, 75a0f14e2ea4)
  • PR adds contributor-facing preflight gate: The PR wires check:secretref-docs into the normal preflight guards, so stale generated SecretRef reference docs can fail future check runs. (scripts/check.mjs:108, 75a0f14e2ea4)

Likely related people:

  • joshavant: Authored the merged SecretRef coverage expansion that introduced or expanded the credential matrix, generator, and credential-surface docs this PR extends. (role: feature-history contributor; confidence: high; commits: 806803b7efe2; files: src/secrets/credential-matrix.ts, scripts/generate-secretref-credential-matrix.ts, docs/reference/secretref-credential-surface.md)
  • steipete: Recent history shows credential matrix docs stabilization in the same docs and registry surface. (role: recent adjacent contributor; confidence: high; commits: 1584acb124a8; files: docs/reference/secretref-credential-surface.md, docs/reference/secretref-user-supplied-credentials-matrix.json, src/secrets/credential-matrix.ts)
  • vincentkoc: Recent history shows work isolating SecretRef docs matrix checks and carrying the same generator/test surface through refactors. (role: recent area contributor; confidence: medium; commits: 01e443755ce3, 7af1def02535; files: src/secrets/target-registry.docs.test.ts, scripts/generate-secretref-credential-matrix.ts, src/secrets/credential-matrix.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Jun 2, 2026
@1052326311

Copy link
Copy Markdown
Contributor Author

Addressed. Both check:secretref-docs and gen:secretref-docs now invoke the generator through node --import tsx after run-with-env. Added two regression assertions in test/package-scripts.test.ts to pin the wrapped command shape so future edits cannot drop back to direct-tsx invocation. All 9 tests in test/package-scripts.test.ts pass and oxlint is clean.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 2, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 2, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 2, 2026
@1052326311
1052326311 force-pushed the fix/secretref-docs-generate-markdown-v2 branch from c9fb0b1 to acace85 Compare June 8, 2026 17:02
@1052326311

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — updated proof with fresh live run output (actual line counts and entry counts from this branch rebased on latest main).

@1052326311

Copy link
Copy Markdown
Contributor Author

Fixed: regenerated the SecretRef credential surface Markdown against current main.

Changes:

  • Ran pnpm gen:secretref-docs — regenerated docs/reference/secretref-credential-surface.md
  • All 94 entries from the JSON matrix are now present in the Markdown, including the 2 previously missing entries:
    • plugins.entries.parallel.config.webSearch.apiKey
    • talk.realtime.providers.*.apiKey
  • pnpm check:secretref-docs (check mode) passes: "secretref reference docs are in sync" ✅

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 9, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 9, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 9, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 9, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 20, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Jun 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 12, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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

Labels

docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant