Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/hub-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
working-directory: hub
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: hub/package.json
node-version: 24
cache: npm
cache-dependency-path: |
hub/package-lock.json
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: hub/package.json
node-version: 24
cache: npm
cache-dependency-path: hub/package-lock.json
- run: npm ci
Expand All @@ -142,7 +142,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: hub/package.json
node-version: 24
cache: npm
cache-dependency-path: hub/package-lock.json
- run: npm ci
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
if: ${{ needs.changes.outputs.hub == 'true' }}
with:
node-version-file: hub/package.json
node-version: 24
cache: npm
cache-dependency-path: hub/package-lock.json
- run: npm ci
Expand All @@ -191,7 +191,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: hub/package.json
node-version: 24
cache: npm
cache-dependency-path: hub/package-lock.json
- run: npm ci
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: hub/package.json
node-version: 24
cache: npm
cache-dependency-path: hub/package-lock.json
- run: npm ci
Expand All @@ -252,7 +252,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: hub/package.json
node-version: 24
cache: npm
cache-dependency-path: hub/package-lock.json
- run: npm ci
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/node-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Node compatibility

on:
pull_request:
paths:
- ".github/workflows/**"
- ".github/extensions/replica-prototype/**"
- "actions/build/**"
- "hub/app/javascript/**"
- "hub/script/**"
- "hub/.storybook/**"
- "hub/*.json"
- "hub/.npmrc"
- "hub/*.ts"
- "hub/*.mjs"
- "packages/learning/**"
- "starter/**"
- "scripts/**"
- "eslint.config.mjs"
push:
branches: [main]
paths:
- ".github/workflows/**"
- ".github/extensions/replica-prototype/**"
- "actions/build/**"
- "hub/app/javascript/**"
- "hub/script/**"
- "hub/.storybook/**"
- "hub/*.json"
- "hub/.npmrc"
- "hub/*.ts"
- "hub/*.mjs"
- "packages/learning/**"
- "starter/**"
- "scripts/**"
- "eslint.config.mjs"

permissions:
contents: read

jobs:
check:
name: Node ${{ matrix.node }} / ${{ matrix.project }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["24.15.0", "26.0.0", "26"]
project: [hub, starter, actions/build, packages/learning]
defaults:
run:
working-directory: ${{ matrix.project }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: npm
cache-dependency-path: ${{ matrix.project }}/package-lock.json
- run: npm ci --ignore-scripts --engine-strict
- name: Install Hub browser-test dependencies
if: ${{ matrix.project == 'hub' }}
run: npm ci --ignore-scripts --omit=dev --engine-strict
working-directory: actions/build
- name: Install Chromium
if: ${{ matrix.project == 'hub' || matrix.project == 'actions/build' }}
run: actions/build/node_modules/.bin/playwright install --with-deps chromium
working-directory: .
- name: Check Hub
if: ${{ matrix.project == 'hub' }}
run: |
npm run lint
npm test
npm run controls:test
REPLICA_CHROMIUM_PATH="$(node -p 'require("../actions/build/node_modules/playwright").chromium.executablePath()')"
export REPLICA_CHROMIUM_PATH
npm run extension:test
npm run build
npm run storybook:build
npm run controls:assets:check
npm run extension:assets:check
- name: Check Starter
if: ${{ matrix.project == 'starter' }}
run: |
npm run format:check
npm run typecheck
npm test
npm run build
- name: Check starter setup and root scripts
if: ${{ matrix.project == 'starter' }}
run: node --test scripts/*.test.mjs
working-directory: .
- name: Check build action
if: ${{ matrix.project == 'actions/build' }}
run: |
npm run lint
npm test
- name: Check Learning
if: ${{ matrix.project == 'packages/learning' }}
run: |
npm run schema:check
npm test
npm run demo
npm run demo:agent-memory-repo
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ For improvements, explain the problem you want to solve and who would benefit. D

## Set up the development environment

Each Node.js project's `engines.node` declares its supported versions. The [Node compatibility workflow](.github/workflows/node-compatibility.yml) checks the lower bounds and current releases across Hub, Starter, the build action, and Learning. The devcontainer, production image, and composite build action retain their pinned runtime defaults; choosing another supported major locally does not change them.

### Replica Hub

Replica Hub uses a devcontainer so contributors run the same Ruby, Node, SQLite, GitHub CLI, and Chromium versions.
Expand Down Expand Up @@ -85,7 +87,7 @@ npm test

### Replica learning

The learning package requires Node.js 24, npm, and Git:
The learning package requires npm, Git, and a Node.js version matching `engines.node` in [packages/learning/package.json](packages/learning/package.json):

```sh
cd packages/learning
Expand Down
2 changes: 1 addition & 1 deletion actions/build/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion actions/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"engines": {
"node": "^24.0.0"
"node": "^24.15.0 || ^26.0.0"
},
"scripts": {
"lint": "eslint . && prettier --check .",
Expand Down
2 changes: 2 additions & 0 deletions docs/testing-and-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ The workflows preserve the existing required check names; skipping an entire wor

When adding a shared dependency or a new project, update the selector and its behavioral tests together. Unclassified paths deliberately run both suites until their dependencies are known. Run `node --test scripts/select-ci-suites.test.mjs` and `ruby scripts/check-ci-workflows.rb` from the repository root. The latter reads the actual workflow gates and checks their success, failure, cancellation, and missing-output behavior; both commands run before CI selects suites. Check changed workflows with `actionlint` when available. Actual job skipping and check reporting still need verification on GitHub after publishing.

The separate [Node compatibility workflow](../.github/workflows/node-compatibility.yml) runs on Node source, dependency, tooling, and workflow changes. It checks every Node project at each supported major's lower bound and the current release, alongside the existing default-runtime checks. It includes browser capture, Controls and extension integration, frontend builds, and Learning demos without changing the container runtime defaults or existing required check names. `scripts/check-ci-workflows.rb` also checks the supported ranges, matching lockfile metadata, and compatibility workflow wiring.

## Update dependencies

Hub and the shared build action wait seven days before resolving newly published dependencies. npm enforces the delay through each project's committed `.npmrc`. Hub's RubyGems source in `Gemfile` applies the delay to Bundler. Dependabot applies the same cooldown to npm, Bundler, and GitHub Actions updates across the repository. The starter manages its dependency resolution independently.
Expand Down
2 changes: 1 addition & 1 deletion hub/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"engines": {
"node": "^24.0.0"
"node": "^24.15.0 || ^26.0.0"
},
"scripts": {
"controls:build": "node script/build-controls-bridge.mjs",
Expand Down
4 changes: 2 additions & 2 deletions packages/learning/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Replica learning

`@github/replica-learning` lets Replica learn from review evidence without training a model. It owns the version 1 learning contracts, the memory provider interface, built-in SQLite, JSON Lines, and in-memory providers, two reference consolidators, a conformance suite, the `replica-learning` command, and an example that plugs in [Agent Memory Repo](examples/agent-memory-repo/README.md). It isn't published to npm yet, so run it from a Replica checkout with Node.js 24.
`@github/replica-learning` lets Replica learn from review evidence without training a model. It owns the version 1 learning contracts, the memory provider interface, built-in SQLite, JSON Lines, and in-memory providers, two reference consolidators, a conformance suite, the `replica-learning` command, and an example that plugs in [Agent Memory Repo](examples/agent-memory-repo/README.md). It isn't published to npm yet, so run it from a Replica checkout with a Node.js version matching `engines.node` in [package.json](package.json).

The design and its trade-offs are in [ADR 0001](../../docs/adr/0001-learning-extension-architecture.md).

Expand Down Expand Up @@ -135,7 +135,7 @@ The module must be inside the checkout and export `createMemoryProvider(options)

| Provider | Choose it with | Stores | Redaction |
| --- | --- | --- | --- |
| SQLite, the default | `"sqlite"` | One database file, with the SQLite driver built into Node.js 24 | Yes |
| SQLite, the default | `"sqlite"` | One database file, with the SQLite driver built into Node.js | Yes |
| JSON Lines | `"jsonl"` | One file per stream that a person can read | Yes |
| In memory | `"in-memory"` | Process memory, for tests | Yes |
| Single file | [`test/fixtures/json-file-provider.mjs`](test/fixtures/json-file-provider.mjs) | One JSON file, written only from the contract with no imports from this package | No |
Expand Down
2 changes: 1 addition & 1 deletion packages/learning/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/learning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"demo:agent-memory-repo": "node examples/agent-memory-repo/demo.mjs"
},
"engines": {
"node": ">=24 <25"
"node": "^24.15.0 || ^26.0.0"
},
"devDependencies": {
"ajv": "8.20.0"
Expand Down
40 changes: 40 additions & 0 deletions scripts/check-ci-workflows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require "open3"
require "tmpdir"
require "fileutils"
require "json"

def check(condition, message)
abort(message) unless condition
Expand Down Expand Up @@ -117,6 +118,45 @@ def expression(value)
end
puts "CI workflow guards and wiring passed (#{checks} shell cases)."

projects = %w[hub starter actions/build packages/learning]
projects.each do |project|
manifest = JSON.parse(File.read(File.join(root, project, "package.json")))
lock = JSON.parse(File.read(File.join(root, project, "package-lock.json")))
check(manifest.dig("engines", "node") == "^24.15.0 || ^26.0.0", "#{project}: supported Node versions changed")
check(lock.dig("packages", "", "engines") == manifest.fetch("engines"), "#{project}: locked Node engines differ from the manifest")
end
workflows.fetch("hub-ci").each do |id, job|
job.fetch("steps", []).each do |step|
next unless step["uses"].to_s.start_with?("actions/setup-node@")

check(step.dig("with", "node-version") == 24, "hub-ci/#{id}: default checks must keep the pinned Node major")
check(!step.fetch("with").key?("node-version-file"), "hub-ci/#{id}: supported ranges must not select the default CI runtime")
end
end
compatibility = YAML.safe_load(File.read(File.join(root, ".github/workflows/node-compatibility.yml")))
check(compatibility.fetch("permissions") == { "contents" => "read" }, "Node compatibility must use read-only repository access")
node_checks = compatibility.fetch("jobs").fetch("check")
check(node_checks.dig("strategy", "matrix", "node") == ["24.15.0", "26.0.0", "26"], "Node compatibility must cover supported lower bounds and current Node 26")
check(node_checks.dig("strategy", "matrix", "project") == projects, "Node compatibility must cover every Node project")
check(node_checks.dig("strategy", "fail-fast") == false, "Node compatibility must report each project and version independently")
check(expression(node_checks.dig("defaults", "run", "working-directory")) == "matrix.project", "Node compatibility must run inside the selected project")
setup_node = node_checks.fetch("steps").find { |step| step["uses"].to_s.start_with?("actions/setup-node@") }
check(setup_node && expression(setup_node.dig("with", "node-version")) == "matrix.node", "Node compatibility must execute the selected version")
check(setup_node.dig("with", "check-latest") == true, "Node compatibility must resolve the current supported release")
check(node_checks.fetch("steps").any? { |step| step["run"] == "npm ci --ignore-scripts --engine-strict" && !step.key?("if") }, "Node compatibility must reject unsupported dependency engines in every project")
{
"hub" => ["npm test", "npm run controls:test", "npm run extension:test", "npm run build", "npm run storybook:build", "npm run lint", "npm run controls:assets:check", "npm run extension:assets:check"],
"starter" => ["npm run format:check", "npm run typecheck", "npm test", "npm run build"],
"actions/build" => ["npm run lint", "npm test"],
"packages/learning" => ["npm run schema:check", "npm test", "npm run demo", "npm run demo:agent-memory-repo"]
}.each do |project, commands|
step = node_checks.fetch("steps").find { |candidate| expression(candidate["if"]) == "matrix.project == '#{project}'" && candidate.key?("run") && candidate["name"].to_s.start_with?("Check ") }
check(step, "Node compatibility must check #{project}")
lines = step.fetch("run").lines.map(&:strip)
commands.each { |command| check(lines.include?(command), "Node compatibility must run #{command} for #{project}") }
end
puts "Node support ranges, lockfiles and compatibility workflow wiring passed."

release = YAML.safe_load(File.read(File.join(root, ".github/workflows/hub-release.yml"))).fetch("jobs")
prepare = release.fetch("prepare")
build = release.fetch("build")
Expand Down
2 changes: 1 addition & 1 deletion starter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"engines": {
"node": ">=24 <25"
"node": "^24.15.0 || ^26.0.0"
},
"scripts": {
"dev": "vite",
Expand Down
Loading