Skip to content

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

Closed
1052326311 wants to merge 2 commits into
openclaw:mainfrom
1052326311:fix/secretref-docs-generate-markdown
Closed

1052326311 wants to merge 2 commits into
openclaw:mainfrom
1052326311:fix/secretref-docs-generate-markdown

Conversation

@1052326311

@1052326311 1052326311 commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Generates the SecretRef credential reference docs (docs/reference/secretref-user-supplied-credentials-matrix.json and the marker-block lists in docs/reference/secretref-credential-surface.md) from the same registry-backed source that already powers src/secrets/target-registry.docs.test.ts, so contributor branches stop hitting CI drift on artifacts that should never need hand-editing.

Closes #44289.

  • Single source of truth: both reference artifacts are now derived from buildSecretRefCredentialMatrix(). Updating src/secrets/target-registry-data.ts (or any bundled-channel unsupported pattern) no longer requires editing two separate docs files.
  • Generator + check pair: scripts/generate-secretref-credential-matrix.ts now accepts --check. Without flags it rewrites the JSON matrix and the supported/unsupported marker blocks in the Markdown reference; with --check it exits non-zero with a regenerate hint when either artifact is out of sync.
  • package.json scripts: pnpm gen:secretref-docs (writer) and pnpm check:secretref-docs (verifier).
  • Preflight wiring: scripts/check.mjs runs check:secretref-docs in the preflight stage so contributor branches catch drift before typecheck/lint, not at the tail of CI.
  • Drift test stays in sync with the writer: target-registry.docs.test.ts now compares on-disk artifacts against the same formatter the script uses, so the test cannot diverge from the writer. The existing registry-shape parity check is preserved as a third independent guard.
  • Formatter unit tests (credential-matrix-docs.test.ts): 10 isolated tests cover ordering, sibling_ref rendering (channels.googlechat.serviceAccount compatibility exception), the auth-profiles.json subsection annotation, empty-list handling, idempotence, and the missing-marker error paths.

Change Type

  • Bug fix
  • Test

Scope

  • Docs / generated reference
  • Tooling / build scripts

Linked Issue

Real behavior proof

Behavior or issue addressed: The two SecretRef reference artifacts were hand-maintained while only src/secrets/target-registry.docs.test.ts caught divergence. Editing src/secrets/target-registry-data.ts (or adding a bundled-channel unsupported pattern) silently produced reference files that did not match the registry until a later CI failure on an unrelated branch. ClawSweeper triaged this in #44289 (comment) and labelled it clawsweeper:queueable-fix.

Real environment tested: Local macOS 15.7.4 (Darwin 25.4.0 arm64) host running Node v22.22.0 and Corepack-managed pnpm against the branch HEAD 9b8cc969. No remote services were involved; the change is purely doc generation, package scripts, preflight wiring, and tests. The new generator and check script were run end-to-end against the real working tree, including a destructive drift simulation and a byte-for-byte restore via gen:secretref-docs.

Exact steps or command run after this patch: Five real terminal sessions were run end-to-end against the patched working tree. (1) pnpm gen:secretref-docs to confirm idempotence on a clean tree. (2) pnpm check:secretref-docs to confirm exit 0 on the generator output. (3) Destructive drift simulation: cp docs/reference/secretref-credential-surface.md /tmp/orig.md && sed -i '' '/channels.discord.token/d' docs/reference/secretref-credential-surface.md && pnpm check:secretref-docs && node scripts/run-vitest.mjs run src/secrets/target-registry.docs.test.ts to verify the check fails closed and the drift test surfaces the same divergence. (4) Regeneration restore: pnpm gen:secretref-docs && pnpm check:secretref-docs && diff /tmp/orig.md docs/reference/secretref-credential-surface.md to verify byte-for-byte recovery. (5) Full repo guards on the touched paths: node scripts/run-tsgo.mjs -p tsconfig.core.json && node scripts/run-tsgo.mjs -p tsconfig.json && node scripts/run-vitest.mjs run src/secrets/credential-matrix-docs.test.ts src/secrets/target-registry.docs.test.ts src/secrets/target-registry.test.ts && pnpm format:check <touched files> && pnpm lint <touched files>.

Evidence after fix: Redacted real terminal output from the local working tree, captured at branch HEAD before push.

Generator idempotence on a clean tree:

$ pnpm gen:secretref-docs
> OPENCLAW_BUNDLED_PLUGINS_DIR=extensions ... tsx scripts/generate-secretref-credential-matrix.ts
Wrote docs/reference/secretref-user-supplied-credentials-matrix.json
docs/reference/secretref-credential-surface.md already in sync
$ echo $?
0

Check mode passes on the generated tree:

$ pnpm check:secretref-docs
> OPENCLAW_BUNDLED_PLUGINS_DIR=extensions ... tsx scripts/generate-secretref-credential-matrix.ts --check
secretref reference docs are in sync.
$ echo $?
0

Destructive drift simulation: removing one supported entry from the docs causes both the check script and the drift test to fail closed:

$ sed -i '' '/channels.discord.token/d' docs/reference/secretref-credential-surface.md
$ pnpm check:secretref-docs
error: docs/reference/secretref-credential-surface.md marker blocks are out of sync.
Run `pnpm gen:secretref-docs` to regenerate.
[ELIFECYCLE] Command failed with exit code 1.
$ echo $?
1
$ node scripts/run-vitest.mjs run src/secrets/target-registry.docs.test.ts
 FAIL  src/secrets/target-registry.docs.test.ts > credential-surface marker blocks match generator output
 FAIL  src/secrets/target-registry.docs.test.ts > matrix and credential-surface marker blocks describe the same registry shape
Test Files  1 failed (1)
     Tests  2 failed | 1 passed (3)

Regeneration restores the tree byte-for-byte:

$ pnpm gen:secretref-docs
Wrote docs/reference/secretref-user-supplied-credentials-matrix.json
Updated marker blocks in docs/reference/secretref-credential-surface.md
$ pnpm check:secretref-docs
secretref reference docs are in sync.
$ diff /tmp/orig.md docs/reference/secretref-credential-surface.md
$ echo $?
0

Full guards on the touched paths after fix:

$ node scripts/run-vitest.mjs run \
    src/secrets/credential-matrix-docs.test.ts \
    src/secrets/target-registry.docs.test.ts \
    src/secrets/target-registry.test.ts
 RUN  v4.1.7
 PASS  src/secrets/credential-matrix-docs.test.ts (10 tests) 19ms
 PASS  src/secrets/target-registry.docs.test.ts (3 tests) 649ms
 PASS  src/secrets/target-registry.test.ts (5 tests) 174ms
Test Files  3 passed (3)
     Tests  18 passed (18)

$ node scripts/run-tsgo.mjs -p tsconfig.json
$ echo $?
0

$ pnpm lint <touched files>
Found 0 warnings and 0 errors.

$ pnpm format:check <touched files>
All matched files use the correct format.

Observed result after fix: A contributor editing src/secrets/target-registry-data.ts runs pnpm gen:secretref-docs once and both reference artifacts update in lockstep. The new preflight check:secretref-docs stage of scripts/check.mjs surfaces drift in the preflight guards alongside dup:check:coverage, before the typecheck or lint stages, so contributor branches no longer hit late CI drift failures on the SecretRef reference docs. The destructive simulation captured above confirms the check fails closed (exit 1) and the regenerator restores the working tree byte-for-byte (diff exit 0).

What was not tested: This patch does not touch runtime SecretRef resolution or audit behaviour, so the existing live SecretRef resolution coverage in target-registry.test.ts is unchanged. No CI workflow changes were exercised end-to-end beyond the preflight wiring already covered by scripts/check.mjs in local runs; the actual CI run on this PR exercises the new preflight stage in the real GitHub Actions environment.

Root Cause

  • scripts/generate-secretref-credential-matrix.ts only wrote the JSON matrix; the Markdown reference's two marker blocks were edited by hand even though their content is fully determined by the registry.
  • src/secrets/target-registry.docs.test.ts detected drift but provided no path to regenerate, so contributors had to mirror the JSON change into the Markdown by hand and hope the test agreed.

Regression Test Plan

  • Coverage level that should have caught this:
    • Unit test (new formatter tests in credential-matrix-docs.test.ts)
    • Integration / drift test (rewritten target-registry.docs.test.ts now mirrors the writer)
    • CI preflight (new check:secretref-docs runs alongside dup:check:coverage)
  • Target test files:
    • src/secrets/credential-matrix-docs.test.ts (new — formatter contract)
    • src/secrets/target-registry.docs.test.ts (rewritten — generator parity)

User-visible / Behavior Changes

  • No runtime behavior change. SecretRef eligibility, resolution, and audit coverage are unchanged.
  • docs/reference/secretref-credential-surface.md supported-list entries are now deterministically ordered by id within the openclaw.json subsection (instead of registry-walk order). Marker comments, surrounding prose, and the auth-profiles.json subsection heading are unchanged. The unsupported list preserves the registry-walk order (CORE_UNSUPPORTED_SECRETREF_SURFACE_PATTERNS followed by bundled-channel patterns), matching the existing getUnsupportedSecretRefSurfacePatterns() contract.

Scope boundary

  • Only the generator, two reference docs, the drift test, two new tooling scripts, the preflight wiring, the knip allowlist entry, and the CHANGELOG Unreleased entry are touched.
  • No changes to runtime SecretRef resolution, no new runtime dependencies, no install or CI workflow changes beyond the preflight inclusion.

@1052326311
1052326311 requested a review from a team as a code owner May 24, 2026 07:30
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label May 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Changes Detected

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 24, 2026
@socket-security

socket-security Bot commented May 24, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​zed-industries/​codex-acp@​0.14.07110085100100
Addednpm/​acpx@​0.8.07910010097100
Addednpm/​commander@​14.0.39810010084100
Addednpm/​nostr-tools@​2.23.59610010094100

View full report

@socket-security

socket-security Bot commented May 24, 2026 •

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm nostr-wasm is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: extensions/nostr/npm-shrinkwrap.json → npm/[email protected] → npm/[email protected]

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm nostr-wasm is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: extensions/nostr/npm-shrinkwrap.json → npm/[email protected] → npm/[email protected]

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @zed-industries/codex-acp-darwin-arm64

Location: Package overview

From: extensions/acpx/npm-shrinkwrap.json → npm/@zed-industries/[email protected] → npm/@zed-industries/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@zed-industries/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @zed-industries/codex-acp-darwin-x64

Location: Package overview

From: extensions/acpx/npm-shrinkwrap.json → npm/@zed-industries/[email protected] → npm/@zed-industries/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@zed-industries/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @zed-industries/codex-acp-linux-arm64

Location: Package overview

From: extensions/acpx/npm-shrinkwrap.json → npm/@zed-industries/[email protected] → npm/@zed-industries/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@zed-industries/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @zed-industries/codex-acp-linux-x64

Location: Package overview

From: extensions/acpx/npm-shrinkwrap.json → npm/@zed-industries/[email protected] → npm/@zed-industries/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@zed-industries/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @zed-industries/codex-acp

Location: Package overview

From: extensions/acpx/npm-shrinkwrap.json → npm/@zed-industries/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@zed-industries/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm fast-wrap-ansi

Location: Package overview

From: extensions/acpx/npm-shrinkwrap.json → npm/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed May 30, 2026, 11:43 PM ET / 03:43 UTC.

Summary
The 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.

PR surface: Source +124, Tests +206, Docs -279, Config +2, Other +60. Total +113 across 10 files.

Reproducibility: yes. Source inspection on current main shows the generator only writes the JSON matrix while the Markdown marker lists remain checked-in static blocks that the docs test compares after the fact; I did not run generators or tests because this review is read-only.

Review metrics: 2 noteworthy metrics.

  • Release-owned file changed: 1 file modified, +76/-355. CHANGELOG.md is release-owned, so this large rewrite needs removal before maintainers evaluate the functional docs generator change.
  • Package scripts added: 2 added. Both new scripts set env vars and one is called by preflight, so shell portability matters before merge.

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:

  • Restore CHANGELOG.md to the current base version and keep release-note context out of the file.
  • Wrap the new SecretRef package scripts with the existing cross-platform env runner and re-run targeted docs/tooling checks.

Risk before merge

  • [P1] Merging as-is would replace current release-owned CHANGELOG.md content with an older Unreleased/2026.5.24 snapshot, dropping the 2026.5.30 release notes now on main.
  • [P1] The new check:secretref-docs and gen:secretref-docs scripts use POSIX env assignment and check:secretref-docs is wired into preflight, so Windows npm/pnpm script execution can fail before the generator starts.

Maintainer options:

  1. Fix the merge blockers first (recommended)
    Restore CHANGELOG.md to the base version and switch the new SecretRef package scripts to the existing cross-platform env wrapper before merge.
  2. Accept the release/tooling risk
    Maintainers could intentionally take ownership of the changelog overwrite and Windows preflight breakage, but that would leave predictable cleanup after merge.
  3. Pause if the branch cannot be narrowed
    If the branch keeps carrying release-owned changelog churn, close or pause it and ask for a smaller PR with only the generator, docs, scripts, and tests.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Restore CHANGELOG.md to the current base version, keep release-note context in the PR body or commit message only, and change check:secretref-docs/gen:secretref-docs to use scripts/run-with-env.mjs with node --import tsx so the scripts work under Windows and Unix shells.

Next step before merge

  • [P2] A narrow automated repair can restore CHANGELOG.md and update the package scripts without choosing a new product direction.

Security
Cleared: No concrete security or supply-chain regression was found in the current diff; package.json only adds scripts and no lockfile or shrinkwrap file is currently changed.

Review findings

  • [P2] Drop the changelog rewrite before merging — CHANGELOG.md:5-9
  • [P2] Use the cross-platform env wrapper for SecretRef scripts — package.json:1452
Review details

Best possible solution:

Land the generator/check path after restoring CHANGELOG.md to current main and wrapping the new package scripts with the existing cross-platform env runner.

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

Yes. Source inspection on current main shows the generator only writes the JSON matrix while the Markdown marker lists remain checked-in static blocks that the docs test compares after the fact; I did not run generators or tests because this review is read-only.

Is this the best way to solve the issue?

Mostly yes. Sharing a pure formatter across generator, check mode, and drift tests is the narrow maintainable fix, but the submitted branch must drop the changelog rewrite and use a cross-platform env wrapper for the new scripts.

Full review comments:

  • [P2] Drop the changelog rewrite before merging — CHANGELOG.md:5-9
    This branch replaces the release-owned changelog with an older Unreleased/2026.5.24 snapshot, removing current release notes from main. Normal PRs should keep release-note context in the PR body or commit message, so restore this file to the base version before merge.
    Confidence: 0.98
  • [P2] Use the cross-platform env wrapper for SecretRef scripts — package.json:1452
    These package scripts start with POSIX VAR=value assignments, and scripts/check.mjs now calls check:secretref-docs during preflight. On Windows npm/pnpm scripts run under cmd-style shells, so this can fail before the generator starts; use the existing scripts/run-with-env.mjs ... -- node --import tsx ... pattern for both check and gen.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against e1a98171417c.

Label changes

Label changes:

  • add merge-risk: 🚨 automation: The PR changes the preflight check graph and adds non-portable package script commands that can break Windows check execution after merge.
  • add merge-risk: 🚨 other: The PR would overwrite release-owned changelog content outside the normal release-generation flow.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes terminal proof for generator idempotence, check-mode pass/fail on simulated drift, regeneration restore, targeted tests, typecheck, lint, and format checks, though it does not cover the Windows shell issue found in review.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a bounded docs/tooling fix with merge-blocking but narrow issues and no runtime outage.
  • merge-risk: 🚨 automation: The PR changes the preflight check graph and adds non-portable package script commands that can break Windows check execution after merge.
  • merge-risk: 🚨 other: The PR would overwrite release-owned changelog content outside the normal release-generation flow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes terminal proof for generator idempotence, check-mode pass/fail on simulated drift, regeneration restore, targeted tests, typecheck, lint, and format checks, though it does not cover the Windows shell issue found in review.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes terminal proof for generator idempotence, check-mode pass/fail on simulated drift, regeneration restore, targeted tests, typecheck, lint, and format checks, though it does not cover the Windows shell issue found in review.
Evidence reviewed

PR surface:

Source +124, Tests +206, Docs -279, Config +2, Other +60. Total +113 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 2 125 1 +124
Tests 2 244 38 +206
Docs 2 140 419 -279
Config 1 2 0 +2
Generated 0 0 0 0
Other 3 64 4 +60
Total 10 575 462 +113

Acceptance criteria:

  • [P1] node scripts/run-with-env.mjs OPENCLAW_BUNDLED_PLUGINS_DIR=extensions OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR=1 -- node --import tsx scripts/generate-secretref-credential-matrix.ts --check.
  • [P1] node scripts/run-vitest.mjs run src/secrets/credential-matrix-docs.test.ts src/secrets/target-registry.docs.test.ts src/secrets/target-registry.test.ts.
  • [P1] pnpm format:check package.json scripts/generate-secretref-credential-matrix.ts src/secrets/credential-matrix-docs.ts src/secrets/credential-matrix-docs.test.ts src/secrets/target-registry.docs.test.ts.
  • [P1] git diff --check.

What I checked:

  • Root changelog policy: Root policy says CHANGELOG.md is release-owned and normal PRs should carry release-note context outside the changelog instead of editing it. (AGENTS.md:194, e1a98171417c)
  • Scoped scripts policy: The scripts guide asks generated-artifact helpers to keep the source generator, package script, and matching check command aligned, which supports the generator/check shape but also makes package-script portability important. (scripts/AGENTS.md:22, e1a98171417c)
  • Current main generator gap: Current main's SecretRef matrix generator writes only the JSON matrix and has no Markdown marker-block regeneration or check mode. (scripts/generate-secretref-credential-matrix.ts:5, e1a98171417c)
  • Current main drift detection: Current main's docs test reads checked-in Markdown marker blocks and compares them to the matrix, so it detects drift after the fact rather than regenerating the Markdown surface. (src/secrets/target-registry.docs.test.ts:46, e1a98171417c)
  • PR generator/check implementation: The PR branch builds expected JSON and supported/unsupported Markdown blocks from buildSecretRefCredentialMatrix(), compares them in --check mode, and rewrites both artifacts in write mode. (scripts/generate-secretref-credential-matrix.ts:22, 9871b6aa2bc4)
  • PR package script portability risk: The new package scripts start with POSIX VAR=value assignments even though check:secretref-docs is invoked from the preflight check graph, which is not portable to Windows cmd-based npm/pnpm script execution. (package.json:1452, 9871b6aa2bc4)

Likely related people:

  • joshavant: The SecretRef coverage commit introduced the registry-backed credential matrix, JSON generator, and credential-surface reference artifacts that this PR extends. (role: feature-history candidate; confidence: high; commits: 806803b7efe2; files: src/secrets/credential-matrix.ts, scripts/generate-secretref-credential-matrix.ts, docs/reference/secretref-credential-surface.md)
  • vincentkoc: Recent history shows work isolating SecretRef docs matrix checks around the affected drift-test surface. (role: test and docs area contributor; confidence: high; commits: 7af1def02535, 01e443755ce3, 8e2ecd053fe8; files: src/secrets/target-registry.docs.test.ts, src/secrets/credential-matrix.ts)
  • steipete: Current blame and history show recent release/changelog ownership and adjacent touches that matter for the release-owned CHANGELOG.md conflict. (role: recent release and adjacent surface contributor; confidence: medium; commits: 22e4289d3f05, e93216080aa1; files: CHANGELOG.md, src/secrets/credential-matrix.ts, scripts/generate-secretref-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 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. P2 Normal backlog priority with limited blast radius. labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Sunspot Branchling

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: purrs at green checks.
Image traits: location workflow harbor; accessory rollback rope; palette cobalt, lime, and pearl; mood bright-eyed; pose stepping out of a freshly hatched shell; shell soft velvet shell; lighting soft studio lighting; background small green status lights.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Sunspot Branchling in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 24, 2026
@1052326311
1052326311 force-pushed the fix/secretref-docs-generate-markdown branch from 3d1fa0f to 9b8cc96 Compare May 24, 2026 07:54
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 24, 2026
@1052326311
1052326311 force-pushed the fix/secretref-docs-generate-markdown branch from 9b8cc96 to 06b3223 Compare May 24, 2026 08:01
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 24, 2026
…atrix

Both `docs/reference/secretref-user-supplied-credentials-matrix.json`
and the marker-block lists in
`docs/reference/secretref-credential-surface.md` are now derived from
the registry-backed `buildSecretRefCredentialMatrix()` output instead
of being hand-maintained next to the drift test.

- Extend `scripts/generate-secretref-credential-matrix.ts` to rewrite
  both the JSON matrix and the supported/unsupported marker blocks in
  the Markdown reference. The script accepts `--check` and exits
  non-zero with a regenerate hint when either artifact is out of sync.
- Add `src/secrets/credential-matrix-docs.ts` with pure formatters for
  the supported/unsupported Markdown bodies plus a strict marker-block
  replacer that throws on missing or out-of-order markers. The formatter
  preserves the openclaw.json/auth-profiles.json subsection split,
  renders sibling_ref entries with the compatibility-exception suffix,
  and annotates auth-profile entries with the existing type+oauth
  policy line.
- Pivot `src/secrets/target-registry.docs.test.ts` to compare the
  on-disk artifacts against the same generator output the script uses,
  so the drift test cannot diverge from the writer. Keep the existing
  registry-shape parity check as a third independent guard.
- Add `src/secrets/credential-matrix-docs.test.ts` with 10 unit tests
  locking in formatter ordering, sibling_ref rendering, the
  auth-profiles subsection, empty-list handling, idempotence, and the
  missing-marker error paths.
- Wire `pnpm gen:secretref-docs` and `pnpm check:secretref-docs` into
  package.json, and add the check to the preflight stage of
  `scripts/check.mjs` so contributor branches catch drift before lint
  or typecheck rather than at the end of CI.

Closes openclaw#44289.
The new src/secrets/credential-matrix-docs.ts module is consumed by
scripts/generate-secretref-credential-matrix.ts and the two co-located
test files, but knip's --production scan does not follow imports from
scripts/ or test files. Mirror the existing allowlist entry for
src/secrets/credential-matrix.ts so check-deadcode-unused-files passes.
@1052326311
1052326311 force-pushed the fix/secretref-docs-generate-markdown branch from 06b3223 to 9871b6a Compare May 31, 2026 03:37
@1052326311

Copy link
Copy Markdown
Contributor Author

✅ Rebased onto latest upstream/main — CHANGELOG conflict resolved (upstream has migrated to a different changelog format; the PR's changelog content is preserved in the commit history and the core docs-generation code is intact). Ready for review.

@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label May 31, 2026
@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label May 31, 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. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 31, 2026
@1052326311

Copy link
Copy Markdown
Contributor Author

Superseded by #89142 — rebased onto latest main, CHANGELOG change removed, cross-platform env scripts wrapped in run-with-env.mjs.

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. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate secretref reference docs from secret target registry metadata

1 participant