Skip to content

Commit fc87360

Browse files
committed
tool updates
1 parent 63793b2 commit fc87360

23 files changed

Lines changed: 1193 additions & 36 deletions

File tree

‎.claude/CLAUDE.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,12 @@ Recent entries in CLAUDE.md for quick context:
218218
---
219219

220220
_Owner: Alison Haire (Wonderland) . Updated: 2026-03-26_
221+
222+
---
223+
224+
### 2026-03-27 — CLAUDE.md verification against repo state
225+
226+
**Done:** Verified CLAUDE.md claims against live repo. Found 8 discrepancies: stale file counts, 16 untracked plan directories, wrong lpd status, stale content scan statuses. Session-state hook confirmed working and reading live files.
227+
**Decisions made:** None
228+
**Blocked on:** Nothing closed out
229+
**Next session picks up:** No action taken — all proposed fixes rejected. Root issue: CLAUDE.md mixed state into rules. State now served by session-state hook. Rules remain in CLAUDE.md.

‎.claude/settings.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,10 @@
6464
]
6565
}
6666
]
67+
},
68+
"permissions": {
69+
"additionalDirectories": [
70+
"/Users/alisonhaire/Documents/Livepeer/Docs-v2-dev/workspace/thread-outputs/sessions"
71+
]
6772
}
6873
}

‎.github/scripts/generate-changelog.js‎

Lines changed: 103 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,22 +1020,24 @@ async function fetchRepoReleases(owner, repoName, repoLabel) {
10201020
}
10211021
}
10221022

1023-
async function processProduct(product) {
1024-
const productName = product.displayName;
1025-
const changelogPath = path.join(
1026-
REPO_ROOT,
1027-
`v2/solutions/${product.key}/changelog.mdx`
1028-
);
1029-
1030-
const hasGitHub = product.github && product.github.releasesActive;
1031-
const hasGitLab = product.gitlab && product.gitlab.releasesActive;
1032-
const gitlabIsPrimary = hasGitLab && product.gitlab.primary;
1023+
/**
1024+
* Process a single changelog target. Branches on target.mode:
1025+
* "releases" → existing GitHub/GitLab release fetching (default behaviour)
1026+
* "commits" → fetchCommitEntries() + optional verifyContractChanges()
1027+
*
1028+
* @param {object} target - Resolved changelog target from loadChangelogTargets()
1029+
*/
1030+
async function processTarget(target) {
1031+
const displayName = target.displayName || target.key;
1032+
// Use outputPath from config — no longer hardcoded to v2/solutions/
1033+
const changelogPath = path.join(REPO_ROOT, target.outputPath);
1034+
const mode = target.mode || "releases";
10331035

10341036
// Build source description for logging
10351037
const sources = [];
1036-
if (hasGitHub) sources.push(`GitHub: ${product.github.org}/${product.github.mainRepo}`);
1037-
if (hasGitLab) sources.push(`GitLab: ${product.gitlab.projectPath}`);
1038-
console.log(`\n═══ ${productName} (${sources.join(" + ")}) ═══`);
1038+
if (target.github) sources.push(`GitHub: ${target.github.org}/${target.github.repo || target.github.mainRepo}`);
1039+
if (target.gitlab) sources.push(`GitLab: ${target.gitlab.projectPath}`);
1040+
console.log(`\n═══ ${displayName} [${mode}] (${sources.join(" + ")}) ═══`);
10391041

10401042
if (!fs.existsSync(changelogPath)) {
10411043
console.log(` Changelog file not found: ${changelogPath} — skipping.`);
@@ -1045,10 +1047,10 @@ async function processProduct(product) {
10451047
// --regenerate: wipe all entries, keep the template header up to the automation zone marker
10461048
if (REGENERATE) {
10471049
const marker = "────────────────────────────────────────────── */}";
1048-
const content = fs.readFileSync(changelogPath, "utf8");
1049-
const markerIdx = content.indexOf(marker);
1050+
const existingContent = fs.readFileSync(changelogPath, "utf8");
1051+
const markerIdx = existingContent.indexOf(marker);
10501052
if (markerIdx !== -1) {
1051-
const truncated = content.slice(0, markerIdx + marker.length) + "\n";
1053+
const truncated = existingContent.slice(0, markerIdx + marker.length) + "\n";
10521054
if (!DRY_RUN) {
10531055
fs.writeFileSync(changelogPath, truncated);
10541056
console.log(` --regenerate: wiped existing entries, kept template header.`);
@@ -1058,12 +1060,75 @@ async function processProduct(product) {
10581060
}
10591061
}
10601062

1063+
// ── Mode: commits ────────────────────────────────────────────────────────────────
1064+
if (mode === "commits") {
1065+
if (!target.github) {
1066+
console.error(` ERROR: mode:commits requires github config in changelogs.${target.key}`);
1067+
return;
1068+
}
1069+
1070+
const commits = await fetchCommitEntries(target);
1071+
console.log(` Fetched ${commits.length} commit(s)`);
1072+
1073+
if (commits.length === 0) {
1074+
console.log(" No commits found.");
1075+
return;
1076+
}
1077+
1078+
const existing = fs.readFileSync(changelogPath, "utf8");
1079+
const newCommits = commits.filter((c) => !existing.includes(`## ${c.tag_name}`));
1080+
1081+
if (newCommits.length === 0) {
1082+
console.log(" All commits already in changelog. Nothing to do.");
1083+
return;
1084+
}
1085+
1086+
console.log(` ${newCommits.length} new commit(s) to add.`);
1087+
1088+
const blocks = [];
1089+
for (const commit of newCommits) {
1090+
let verifications = [];
1091+
if (target.contract || CONTRACT) {
1092+
verifications = await verifyContractChanges(commit, target);
1093+
}
1094+
blocks.push(buildCommitUpdateBlock(commit, verifications, target));
1095+
}
1096+
1097+
const output = blocks.join("\n");
1098+
const marker = "────────────────────────────────────────────── */}";
1099+
const markerIdx = existing.indexOf(marker);
1100+
1101+
if (markerIdx === -1) {
1102+
console.error(` ERROR: Could not find automation zone marker in ${changelogPath}`);
1103+
return;
1104+
}
1105+
1106+
const insertAt = markerIdx + marker.length;
1107+
const updated = existing.slice(0, insertAt) + "\n\n" + output + "\n" + existing.slice(insertAt);
1108+
1109+
if (DRY_RUN) {
1110+
console.log(`\n ── DRY RUN ── Would write to ${changelogPath}:\n`);
1111+
console.log(output);
1112+
console.log(`\n ── ${newCommits.length} block(s) would be added.`);
1113+
return;
1114+
}
1115+
1116+
fs.writeFileSync(changelogPath, updated);
1117+
console.log(` Written ${newCommits.length} new commit(s) to ${changelogPath}`);
1118+
return;
1119+
}
1120+
1121+
// ── Mode: releases (default) ─────────────────────────────────────────────────────────────────────────
1122+
const hasGitHub = target.github && (target.github.releasesActive || target.github.mainRepo || target.github.repo);
1123+
const hasGitLab = target.gitlab && target.gitlab.releasesActive;
1124+
const gitlabIsPrimary = hasGitLab && target.gitlab.primary;
1125+
10611126
// Fetch releases from GitHub
10621127
let githubReleases = [];
10631128
if (hasGitHub) {
1064-
const owner = product.github.org;
1065-
const changelogRepos = product.github.changelogRepos || [
1066-
{ repo: product.github.mainRepo, label: product.github.mainRepo },
1129+
const owner = target.github.org;
1130+
const changelogRepos = target.github.changelogRepos || [
1131+
{ repo: target.github.mainRepo || target.github.repo, label: target.github.mainRepo || target.github.repo },
10671132
];
10681133
for (const { repo, label } of changelogRepos) {
10691134
const releases = await fetchRepoReleases(owner, repo, label);
@@ -1075,12 +1140,12 @@ async function processProduct(product) {
10751140
// Fetch releases from GitLab
10761141
let gitlabReleases = [];
10771142
if (hasGitLab) {
1078-
const changelogRepos = product.gitlab.changelogRepos || [
1079-
{ projectId: product.gitlab.projectId, projectPath: product.gitlab.projectPath, label: productName },
1143+
const changelogRepos = target.gitlab.changelogRepos || [
1144+
{ projectId: target.gitlab.projectId, projectPath: target.gitlab.projectPath, label: displayName },
10801145
];
10811146
for (const { projectId, label } of changelogRepos) {
10821147
const releases = await fetchGitLabRepoReleases(
1083-
product.gitlab.instanceUrl,
1148+
target.gitlab.instanceUrl,
10841149
projectId,
10851150
label
10861151
);
@@ -1126,18 +1191,18 @@ async function processProduct(product) {
11261191
console.log(` ${newReleases.length} new release(s) to add.`);
11271192

11281193
// Determine if this is a multi-repo product (GitHub side)
1129-
const githubChangelogRepos = (hasGitHub && product.github.changelogRepos) || [];
1194+
const githubChangelogRepos = (hasGitHub && target.github.changelogRepos) || [];
11301195
const isMultiRepo = githubChangelogRepos.length > 1;
1131-
const owner = hasGitHub ? product.github.org : "";
1196+
const owner = hasGitHub ? target.github.org : "";
11321197

11331198
// Generate Update blocks
11341199
const blocks = [];
11351200
for (const release of newReleases) {
11361201
const repo = release._repo;
11371202
const repoLabel = release._repoLabel;
1138-
const displayName = isMultiRepo
1139-
? `${productName} ${repoLabel}`
1140-
: productName;
1203+
const releaseDisplayName = isMultiRepo
1204+
? `${displayName} ${repoLabel}`
1205+
: displayName;
11411206
const labelForBlock = isMultiRepo ? repoLabel : null;
11421207

11431208
// Find previous tag within the same source for commit comparison
@@ -1151,7 +1216,7 @@ async function processProduct(product) {
11511216
: null;
11521217

11531218
// Pass GitLab config for commit fetching when source is GitLab
1154-
const gitlabConfig = release._source === "gitlab" ? product.gitlab : null;
1219+
const gitlabConfig = release._source === "gitlab" ? target.gitlab : null;
11551220

11561221
if (ENHANCE) {
11571222
blocks.push(
@@ -1160,13 +1225,13 @@ async function processProduct(product) {
11601225
prevTag,
11611226
owner,
11621227
repo,
1163-
displayName,
1228+
releaseDisplayName,
11641229
labelForBlock,
11651230
gitlabConfig
11661231
)
11671232
);
11681233
} else {
1169-
blocks.push(generateUpdateBlockRaw(release, displayName, labelForBlock));
1234+
blocks.push(generateUpdateBlockRaw(release, releaseDisplayName, labelForBlock));
11701235
}
11711236
}
11721237

@@ -1202,18 +1267,22 @@ async function processProduct(product) {
12021267
);
12031268
}
12041269

1270+
12051271
async function main() {
1206-
const products = loadProductConfig(PRODUCT_KEY);
1272+
const targets = loadChangelogTargets(CHANGELOG_KEY, CHANGELOG_CATEGORY);
12071273

12081274
console.log(
1209-
`Processing ${products.length} product(s) (limit: ${LIMIT} releases each)`
1275+
`Processing ${targets.length} changelog target(s) (limit: ${LIMIT} entries each)`
12101276
);
12111277
if (ENHANCE) {
12121278
console.log(`LLM enhancement enabled (provider: ${LLM_PROVIDER})`);
12131279
}
1280+
if (CONTRACT) {
1281+
console.log(`Contract mode: on-chain verification enabled`);
1282+
}
12141283

1215-
for (const product of products) {
1216-
await processProduct(product);
1284+
for (const target of targets) {
1285+
await processTarget(target);
12171286
}
12181287

12191288
console.log("\nDone.");

‎.github/workflows/check-docs-guide-catalogs.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,13 @@ jobs:
4646

4747
- name: Verify pages catalog is current
4848
run: node operations/scripts/generators/governance/catalogs/generate-docs-guide-pages-index.js --check
49+
50+
- name: Check frontmatter taxonomy on changed docs pages
51+
if: github.event_name == 'pull_request'
52+
run: |
53+
CHANGED=$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep -E '^(v2|docs-guide)/.*\.mdx$' | tr '\n' ',' | sed 's/,$//')
54+
if [ -n "$CHANGED" ]; then
55+
node operations/tests/unit/quality.test.js --files "$CHANGED"
56+
else
57+
echo "No routable docs pages changed — skipping frontmatter check."
58+
fi
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Update Changelogs
2+
3+
# Weekly on Mondays at 00:00 UTC (11:00 AM AEDT).
4+
# Processes all managed changelog targets in product-social-config.json changelogs{}.
5+
# Manual trigger available with key, category, dry-run, and branch options.
6+
# Replaces update-solutions-changelog.yml — handles solutions, contracts, and resources.
7+
8+
on:
9+
schedule:
10+
- cron: "0 0 * * 1" # Weekly Monday 00:00 UTC
11+
12+
repository_dispatch:
13+
types: [solution-release, governor-scripts-update]
14+
15+
workflow_dispatch:
16+
inputs:
17+
changelog_key:
18+
description: "Changelog key (e.g. daydream, contracts). Leave blank to run all."
19+
required: false
20+
category:
21+
description: "Filter by category (solutions | resources). Leave blank for all."
22+
required: false
23+
type: choice
24+
options:
25+
- ""
26+
- solutions
27+
- resources
28+
default: ""
29+
dry_run:
30+
description: "Dry run — show what would change without writing"
31+
type: boolean
32+
default: false
33+
use_test_branch:
34+
description: "Write to TEST_BRANCH (docs-v2-dev) instead of DEPLOY_BRANCH"
35+
type: boolean
36+
default: false
37+
enhance:
38+
description: "Use LLM to summarise release notes (falls back to raw on failure)"
39+
type: boolean
40+
default: true
41+
llm_provider:
42+
description: "LLM provider: openrouter or copilot"
43+
type: choice
44+
options:
45+
- openrouter
46+
- copilot
47+
default: openrouter
48+
49+
jobs:
50+
update-changelogs:
51+
runs-on: ubuntu-latest
52+
53+
permissions:
54+
contents: write
55+
56+
steps:
57+
- name: Checkout docs repository
58+
uses: actions/checkout@v4
59+
with:
60+
ref: ${{ inputs.use_test_branch == 'true' && vars.TEST_BRANCH || vars.DEPLOY_BRANCH }}
61+
token: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Setup Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: "20"
67+
68+
- name: Generate changelog entries (enhanced)
69+
id: enhanced
70+
if: inputs.enhance != 'false'
71+
continue-on-error: true
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
75+
CHANGELOG_KEY: ${{ inputs.changelog_key || '' }}
76+
CHANGELOG_CATEGORY: ${{ inputs.category || '' }}
77+
ARBISCAN_API_KEY: ${{ secrets.ARBISCAN_API_KEY }}
78+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
79+
LLM_PROVIDER: ${{ inputs.llm_provider || 'openrouter' }}
80+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
81+
COPILOT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
LIMIT: "10"
83+
run: |
84+
FLAGS="--enhance"
85+
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
86+
FLAGS="$FLAGS --dry-run"
87+
fi
88+
# Add --contract flag when targeting the contracts changelog
89+
if [[ "${{ inputs.changelog_key }}" == "contracts" ]] || [[ "${{ github.event.action }}" == "governor-scripts-update" ]]; then
90+
FLAGS="$FLAGS --contract"
91+
fi
92+
node .github/scripts/generate-changelog.js $FLAGS
93+
94+
- name: Generate changelog entries (fallback — no LLM)
95+
if: inputs.enhance == 'false' || steps.enhanced.outcome == 'failure'
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
99+
CHANGELOG_KEY: ${{ inputs.changelog_key || '' }}
100+
CHANGELOG_CATEGORY: ${{ inputs.category || '' }}
101+
ARBISCAN_API_KEY: ${{ secrets.ARBISCAN_API_KEY }}
102+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
103+
LIMIT: "10"
104+
run: |
105+
FLAGS=""
106+
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
107+
FLAGS="--dry-run"
108+
fi
109+
if [[ "${{ inputs.changelog_key }}" == "contracts" ]] || [[ "${{ github.event.action }}" == "governor-scripts-update" ]]; then
110+
FLAGS="$FLAGS --contract"
111+
fi
112+
echo "Running without LLM enhancement (fallback)"
113+
node .github/scripts/generate-changelog.js $FLAGS
114+
115+
- name: Check for changes
116+
if: inputs.dry_run != 'true'
117+
id: git-check
118+
run: |
119+
git diff --exit-code v2/solutions/ v2/resources/changelog/ || echo "changed=true" >> $GITHUB_OUTPUT
120+
121+
- name: Commit and push if changed
122+
if: steps.git-check.outputs.changed == 'true' && inputs.dry_run != 'true'
123+
run: |
124+
git config --global user.name 'github-actions[bot]'
125+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
126+
git add v2/solutions/*/changelog.mdx v2/resources/changelog/*.mdx
127+
git commit -m "chore: update changelogs with new entries [skip ci]"
128+
git push

‎docs.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3246,6 +3246,7 @@
32463246
"pages": [
32473247
"v2/resources/changelog/changelog",
32483248
"v2/resources/changelog/go-livepeer",
3249+
"v2/resources/changelog/contracts",
32493250
"v2/resources/changelog/migration-guide"
32503251
]
32513252
}

0 commit comments

Comments
 (0)