Skip to content

docs(secrets): generate secretref reference docs from target registry metadata - #91612

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

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

Conversation

@aniruddhaadak80

@aniruddhaadak80 aniruddhaadak80 commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR automates the generation of the secretref matrix JSON and reference markdown documentation from secret target registry metadata.

Details:

  • Add scripts/generate-secretref-credential-matrix.ts script to compile the secretref credentials matrix and sync with docs/reference/secretref-credential-surface.md.
  • Add secretref:docs:check and secretref:docs:gen npm scripts to package.json.
  • Integrate secretref:docs:check into the docs checking suite pnpm check:docs.

Closes #44289

Evidence

``console
$ pnpm run secretref:docs:gen
SecretRef reference docs and matrix generated successfully.

$ pnpm run secretref:docs:check
SecretRef reference docs are up to date.
``

Copilot AI review requested due to automatic review settings June 9, 2026 04:25
@aniruddhaadak80
aniruddhaadak80 requested a review from a team as a code owner June 9, 2026 04:25
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S labels Jun 9, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: c4e886d26d46290bd8cb80abac13b91586a0762a

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a generator/check script to keep SecretRef reference docs in sync with the credential matrix, wires it into the docs CI checks, and refreshes the published “credential surface” lists accordingly.

Changes:

  • Added scripts/generate-secretref-docs.ts to generate/update the matrix JSON and supported/unsupported surface lists.
  • Added secretref:docs:* package scripts and integrated the check into check:docs.
  • Updated docs/reference/secretref-credential-surface.md lists to reflect the generated supported/unsupported credential surface.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
scripts/generate-secretref-docs.ts Implements the generation + drift check logic for SecretRef reference docs.
package.json Adds scripts to run the generator/check and includes the check in check:docs.
docs/reference/secretref-credential-surface.md Updates the supported/unsupported lists within the marker blocks.

Comment thread scripts/generate-secretref-docs.ts Outdated
Comment on lines +80 to +86
const currentMatrix = fs.readFileSync(matrixPath, "utf8");
const currentSurface = fs.readFileSync(surfacePath, "utf8").replace(/\r\n/g, "\n");

let drift = false;
if (currentMatrix !== matrixJson) {
console.error("Drift detected in secretref-user-supplied-credentials-matrix.json");
drift = true;
Comment thread scripts/generate-secretref-docs.ts Outdated
Comment on lines +30 to +34
for (const line of originalSurface.split(/\r?\n/)) {
const match = line.match(/^- `([^`]+)`/);
if (match) {
lineMap.set(match[1], line);
}
Comment thread scripts/generate-secretref-docs.ts Outdated
Comment on lines +5 to +6
const CHECK = process.argv.includes("--check");
const WRITE = process.argv.includes("--write");
Comment thread scripts/generate-secretref-docs.ts Outdated
Comment on lines +75 to +79
if (WRITE) {
fs.writeFileSync(matrixPath, matrixJson, "utf8");
fs.writeFileSync(surfacePath, newSurface, "utf8");
console.log("SecretRef reference docs generated successfully.");
} else if (CHECK) {
Comment thread scripts/generate-secretref-docs.ts Outdated
Comment on lines +98 to +101
} else {
console.error("Please specify --check or --write");
process.exit(1);
}
@clawsweeper

clawsweeper Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 8:06 PM ET / 00:06 UTC.

Summary
The PR extends the SecretRef credential matrix generator to write/check both the JSON matrix and Markdown credential-surface reference, adds package scripts, and wires the new check into docs validation.

PR surface: Docs 0, Config +2, Other +99. Total +101 across 3 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 gate: 2 package scripts added, 1 docs check changed. The PR changes contributor-facing docs verification by adding SecretRef generated-reference enforcement to check:docs.

Stored data model
Persistent data-model change detected: serialized state: scripts/generate-secretref-credential-matrix.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 one candidate fix, with one overlapping open sibling 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: 🦪 silver shellfish
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof is added.

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

Rank-up moves:

  • [P1] Add redacted terminal output or logs for pnpm secretref:docs:gen, pnpm secretref:docs:check, and a focused SecretRef docs validation path on the current head.
  • [P1] Render SecretRef Markdown annotations from matrix metadata and add focused formatter or drift coverage for sibling-ref and auth-profile annotations.
  • [P1] Add redacted current-head terminal output or logs for generation, check mode, and a drift/regeneration validation path.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body includes copied generator/check output, but it is not tied to the current head and does not show the drift-detection plus regeneration path after the latest rebase. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The new check:docs step intentionally adds a generated-reference gate, so a flawed formatter can create false confidence or fail future contributor docs checks.
  • [P1] The branch is currently CONFLICTING/DIRTY against main; conflict resolution needs to preserve current main's docs checks, including docs:map:check.
  • [P1] Two open PRs target the same canonical SecretRef docs-generation issue, so maintainers should choose one implementation path rather than land competing generators.
  • [P1] The contributor proof is not strong enough for this head because it does not show drift detection plus regeneration after the latest rebase.

Maintainer options:

  1. Repair this branch before merge (recommended)
    Derive annotation text from matrix metadata, resolve conflicts while preserving current docs checks, and add current-head drift/regeneration proof before this branch lands.
  2. Adopt the sibling implementation
    Use the overlapping sibling PR as the canonical path if maintainers prefer its formatter and proof after refreshing it on main.
  3. Accept the generated-doc gate deliberately
    Maintainers can accept the new docs gate once the formatter source-of-truth issue and proof gap are resolved.

Next step before merge

  • [P1] Human follow-up is needed for proof, the formatter source-of-truth fix, conflict resolution, and choosing one canonical PR across the overlapping SecretRef generator implementations.

Maintainer decision needed

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

Review findings

  • [P2] Derive annotations from matrix metadata — scripts/generate-secretref-credential-matrix.ts:40
Review details

Best possible solution:

Land one canonical generator/check implementation that renders Markdown annotations from matrix metadata, preserves current docs checks, includes focused formatter/drift coverage, and has current-head terminal proof.

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?

No for this PR as-is. Extending the existing generator is the right direction, but this patch still treats checked-in Markdown annotations as expected output instead of deriving them from registry metadata.

Full review comments:

  • [P2] Derive annotations from matrix metadata — scripts/generate-secretref-credential-matrix.ts:40
    The generator builds expected Markdown by reading the current docs into lineMap, then reusing lineMap.get(key) for generated lines. Because --check uses that same file as the expected source, stale or manually edited annotations for an existing key can pass; render these annotations from matrixData.entries metadata and cover that formatter behavior.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded docs/tooling reliability PR with limited runtime blast radius but real merge blockers.
  • merge-risk: 🚨 automation: The PR wires a new SecretRef generated-doc check into check:docs, which can fail future contributor and CI docs checks when generated references drift or the formatter is wrong.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body includes copied generator/check output, but it is not tied to the current head and does not show the drift-detection plus regeneration path after the latest rebase. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Docs 0, Config +2, Other +99. Total +101 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 74 74 0
Config 1 3 1 +2
Generated 0 0 0 0
Other 1 107 8 +99
Total 3 184 83 +101

What I checked:

  • Current main generator gap: Current main's SecretRef generator writes only docs/reference/secretref-user-supplied-credentials-matrix.json and has no Markdown marker-block writer or check mode. (scripts/generate-secretref-credential-matrix.ts:13, 5199f55ebe64)
  • Current main only detects Markdown drift after the fact: The current docs test reads marker blocks from docs/reference/secretref-credential-surface.md and compares their path sets to the matrix, which detects drift but does not regenerate the Markdown reference. (src/secrets/target-registry.docs.test.ts:52, 5199f55ebe64)
  • Latest release has the same generator gap: v2026.6.11 contains the same JSON-only generator and after-the-fact Markdown docs test, so the requested behavior has not shipped. (scripts/generate-secretref-credential-matrix.ts:13, e085fa1a3ffd)
  • PR head still uses checked-in Markdown as expected annotation source: On the PR head, generated Markdown lines reuse lineMap.get(key) from the current Markdown file, so stale annotations for existing keys can pass check mode instead of being derived from matrix metadata. (scripts/generate-secretref-credential-matrix.ts:40, c4e886d26d46)
  • Matrix already carries annotation inputs: Current matrix entries expose refPath, when, secretShape, and notes fields that can render sibling-ref and auth-profile annotation text from registry-backed data. (src/secrets/credential-matrix.ts:39, 5199f55ebe64)
  • PR changes contributor-facing docs automation: The PR adds secretref:docs:check and secretref:docs:gen and prepends the SecretRef docs check to check:docs, creating a new generated-reference gate. (package.json:1523, c4e886d26d46)

Likely related people:

  • joshavant: Authored the merged SecretRef coverage expansion that introduced or expanded the credential matrix, JSON generator, and credential-surface docs this PR extends. (role: feature-history contributor; confidence: high; commits: 806803b7efe2, 788f56f30fd9; files: src/secrets/credential-matrix.ts, scripts/generate-secretref-credential-matrix.ts, docs/reference/secretref-credential-surface.md)
  • steipete: Merged the original SecretRef coverage PR and later authored credential matrix docs stabilization in the same surface. (role: recent adjacent contributor and merger; 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 in the same after-the-fact drift-test surface this PR is replacing with generation. (role: recent test/docs area contributor; confidence: medium; commits: 01e443755ce3; files: src/secrets/target-registry.docs.test.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.
Review history (2 earlier review cycles)
  • reviewed 2026-06-28T13:09:49.449Z sha c4e886d :: needs real behavior proof before merge. :: [P2] Derive annotations from matrix metadata
  • reviewed 2026-07-05T13:23:16.131Z sha c4e886d :: needs real behavior proof before merge. :: [P2] Derive annotations from matrix metadata

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. labels Jun 9, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 15, 2026
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/generate-secretref-docs branch from 1ec77ba to c4e886d Compare June 28, 2026 13:01
@aniruddhaadak80

Copy link
Copy Markdown
Contributor Author

Rebased onto main, consolidated the SecretRef matrix and surface documentation generators into generate-secretref-credential-matrix.ts, deleted the duplicate generate-secretref-docs.ts script, and restored the distinct structure for auth-profiles.json targets in docs/reference/secretref-credential-surface.md. Local unit tests pass. Ready for re-review.

@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jun 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 28, 2026
@aniruddhaadak80

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 5, 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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 6, 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 21, 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: S stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate secretref reference docs from secret target registry metadata

2 participants